david/ipxe
Archived
1
0

[bios] Fix screen clearing on even more buggy BIOSes

Some BIOSes (observed with a ProLiant DL360p Gen8 SE) perform no range
checking whatsoever on the parameters passed to INT10,06 and will
therefore happily write to an area beyond the end of video RAM.  The
area immediately following the video RAM tends to be the VGA BIOS ROM
image.  Overwriting the VGA BIOS leads to an interesting variety of
crashes and reboots.

Fix by specifying an exact width and height to be cleared, rather than
passing in large values and relying upon the BIOS to truncate them to
the appropriate range.

Reported-by: Alex Davies <adavies@jumptrading.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-03-21 11:07:29 +00:00
parent ccb6e5c627
commit c1595129b5

View File

@ -101,7 +101,9 @@ static void bios_handle_ed ( struct ansiesc_context *ctx __unused,
"int $0x10\n\t"
"cli\n\t" )
: : "a" ( 0x0600 ), "b" ( bios_attr << 8 ),
"c" ( 0 ), "d" ( 0xfefe ) );
"c" ( 0 ),
"d" ( ( ( console_height - 1 ) << 8 ) |
( console_width - 1 ) ) );
}
/**