On 15.01.26 10:17, Gerd Hoffmann via SeaBIOS wrote:
On Tue, Jan 06, 2026 at 12:49:01AM +0000, Alexander Graf via SeaBIOS wrote:
Implement catch-all mechanism to handle invalid boot loaders that execute
random instructions and reach the VGA hole at 0xa0000, which would lead to
VM crashes with KVM_INTERNAL_ERROR.
When a BIOS boot loader gets corrupted, it can end up jumping across
address space and execute stray code. The typical symptom of that is
that it executes 0x0 (addw) instructions until the code reaches an MMIO
region, such as the VGA window. When running in KVM, attempting to
execute code from the MMIO window results in KVM_INTERNAL_ERROR exits
which crash the VM.
To prevent VM crashes before we reach such an MMIO window, introduce an
internal int 0xf0 handler and call it at strategic locations that should
never get executed in the first place. When we now have stray code
executing, these int calls cause an emergency print of "BIOS failed to
boot volume" and cleanly shut down the machine.
Does it make sense to include a hint in the error message that a
corrupted disk / boot loader might be the root cause?
Definitely! Will add in v2.
I've never seen that, care to share some real world examples where
this actually happens?
We've seen it multiple times over the last few years, usually when users
corrupt their grub stage 1.5 partition. The latest iteration was a
customer downgrading Debian 13 to 11 which wiped the stage 1.5 partition
("BIOS boot"), but then failed to install the old boot loader into it
again. dd if=/dev/zero of=/dev/nvme0n1p14 on Ubuntu 20.04 was also how I
reproduced it.
Alex
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
_______________________________________________
SeaBIOS mailing list -- [email protected]
To unsubscribe send an email to [email protected]