grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] commands/videoinfo: Prevent crash when run while video drive


From: Daniel Kiper
Subject: Re: [PATCH] commands/videoinfo: Prevent crash when run while video driver already active
Date: Mon, 14 Aug 2023 16:04:45 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Aug 11, 2023 at 04:30:04PM -0500, Glenn Washburn wrote:
> 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
> comand 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>

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]