[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-2aa958c99c7fd3162b089a1a56a34a0cdb778de1@git.kernel.org>
Date: Fri, 1 Feb 2019 09:36:56 -0800
From: tip-bot for Kairui Song <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: x86@...nel.org, hpa@...or.com, takahiro.akashi@...aro.org,
linux-kernel@...r.kernel.org, bp@...e.de, dyoung@...hat.com,
akpm@...ux-foundation.org, tglx@...utronix.de, dhowells@...hat.com,
yannik@...britzki.me, kasong@...hat.com, mingo@...hat.com,
prudo@...ux.vnet.ibm.com, ard.biesheuvel@...aro.org,
mingo@...nel.org
Subject: [tip:x86/urgent] x86/kexec: Don't setup EFI info if EFI runtime is
not enabled
Commit-ID: 2aa958c99c7fd3162b089a1a56a34a0cdb778de1
Gitweb: https://git.kernel.org/tip/2aa958c99c7fd3162b089a1a56a34a0cdb778de1
Author: Kairui Song <kasong@...hat.com>
AuthorDate: Fri, 18 Jan 2019 19:13:08 +0800
Committer: Borislav Petkov <bp@...e.de>
CommitDate: Fri, 1 Feb 2019 18:18:54 +0100
x86/kexec: Don't setup EFI info if EFI runtime is not enabled
Kexec-ing a kernel with "efi=noruntime" on the first kernel's command
line causes the following null pointer dereference:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
#PF error: [normal kernel read fault]
Call Trace:
efi_runtime_map_copy+0x28/0x30
bzImage64_load+0x688/0x872
arch_kexec_kernel_image_load+0x6d/0x70
kimage_file_alloc_init+0x13e/0x220
__x64_sys_kexec_file_load+0x144/0x290
do_syscall_64+0x55/0x1a0
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Just skip the EFI info setup if EFI runtime services are not enabled.
[ bp: Massage commit message. ]
Suggested-by: Dave Young <dyoung@...hat.com>
Signed-off-by: Kairui Song <kasong@...hat.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Acked-by: Dave Young <dyoung@...hat.com>
Cc: AKASHI Takahiro <takahiro.akashi@...aro.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: bhe@...hat.com
Cc: David Howells <dhowells@...hat.com>
Cc: erik.schmauss@...el.com
Cc: fanc.fnst@...fujitsu.com
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: kexec@...ts.infradead.org
Cc: lenb@...nel.org
Cc: linux-acpi@...r.kernel.org
Cc: Philipp Rudo <prudo@...ux.vnet.ibm.com>
Cc: rafael.j.wysocki@...el.com
Cc: robert.moore@...el.com
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: x86-ml <x86@...nel.org>
Cc: Yannik Sembritzki <yannik@...britzki.me>
Link: https://lkml.kernel.org/r/20190118111310.29589-2-kasong@redhat.com
---
arch/x86/kernel/kexec-bzimage64.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 0d5efa34f359..53917a3ebf94 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -167,6 +167,9 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
struct efi_info *current_ei = &boot_params.efi_info;
struct efi_info *ei = ¶ms->efi_info;
+ if (!efi_enabled(EFI_RUNTIME_SERVICES))
+ return 0;
+
if (!current_ei->efi_memmap_size)
return 0;
Powered by blists - more mailing lists