grub/grub-core
Glenn Washburn 1de5832699 commands/videoinfo: Prevent crash when run while video driver already active
The videoinfo command will initialize all non-active video adapters. Video
drivers tend to zero out the global framebuffer object on initialization.
This is not a problem when there is no active video adapter. However, when
there is, then outputting to the video adapter will cause a crash because
methods in the framebuffer object are reinitialized. For example, this
command sequence will cause a crash.

  terminal_output --append gfxterm; videoinfo

When running in a QEMU headless with GRUB built for the x86_64-efi target,
the first command initializes the Bochs video adapter, which, among
other things, sets the set_page() member function. Then when videoinfo is
run, all non-Bochs video adapters will be initialized, each one wiping
the framebuffer and thus setting set_page to NULL. Soon after the videoinfo
command finishes there will be a call to grub_refresh(), which will
ultimately call the framebuffer's set_page which will be NULL and cause
a crash when called.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2023-08-14 18:04:04 +02:00
..
2023-06-01 11:45:00 +02:00
2023-06-13 14:48:38 +02:00
2023-01-19 17:39:04 +01:00
2023-06-01 11:45:00 +02:00
2023-06-01 11:45:00 +02:00
2022-03-14 16:00:27 +01:00
2023-06-23 00:50:38 +02:00
2017-05-03 12:49:31 +02:00
2023-06-23 00:50:38 +02:00
2023-06-23 00:50:38 +02:00
2017-05-03 12:49:31 +02:00