mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
x86/efistub: Don't clear BSS twice in mixed mode
[ Upstream commitdf7ecce842
] Clearing BSS should only be done once, at the very beginning. efi_pe_entry() is the entrypoint from the firmware, which may not clear BSS and so it is done explicitly. However, efi_pe_entry() is also used as an entrypoint by the mixed mode startup code, in which case BSS will already have been cleared, and doing it again at this point will corrupt global variables holding the firmware's GDT/IDT and segment selectors. So make the memset() conditional on whether the EFI stub is running in native mode. Fixes:b3810c5a2c
("x86/efistub: Clear decompressor BSS in native EFI entrypoint") Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f07ffd18d7
commit
4b0c547923
@ -434,7 +434,8 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
|
||||
efi_status_t status;
|
||||
char *cmdline_ptr;
|
||||
|
||||
memset(_bss, 0, _ebss - _bss);
|
||||
if (efi_is_native())
|
||||
memset(_bss, 0, _ebss - _bss);
|
||||
|
||||
efi_system_table = sys_table_arg;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user