]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/kexec: Use up-to-dated screen_info copy to fill boot params
authorKairui Song <kasong@redhat.com>
Wed, 14 Oct 2020 09:24:28 +0000 (17:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 09:22:19 +0000 (10:22 +0100)
commita05262846df1c4f125815ba81b1de9472ec0a1e3
tree47985f4f2932fa5ce618b0ac56d156c7d8239f51
parent39f68339223d47d778cc757963dfaa8001830a88
x86/kexec: Use up-to-dated screen_info copy to fill boot params

[ Upstream commit afc18069a2cb7ead5f86623a5f3d4ad6e21f940d ]

kexec_file_load() currently reuses the old boot_params.screen_info,
but if drivers have change the hardware state, boot_param.screen_info
could contain invalid info.

For example, the video type might be no longer VGA, or the frame buffer
address might be changed. If the kexec kernel keeps using the old screen_info,
kexec'ed kernel may attempt to write to an invalid framebuffer
memory region.

There are two screen_info instances globally available, boot_params.screen_info
and screen_info. Later one is a copy, and is updated by drivers.

So let kexec_file_load use the updated copy.

[ mingo: Tidied up the changelog. ]

Signed-off-by: Kairui Song <kasong@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20201014092429.1415040-2-kasong@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/kexec-bzimage64.c