]>
Commit | Line | Data |
---|---|---|
6cfd1cde GKH |
1 | From f72075c9eda8a43aeea2f9dbb8d187afd4a76f0b Mon Sep 17 00:00:00 2001 |
2 | From: Alex Thorlton <athorlton@sgi.com> | |
3 | Date: Thu, 11 Aug 2016 11:41:59 +0100 | |
4 | Subject: x86/platform/uv: Skip UV runtime services mapping in the efi_runtime_disabled case | |
5 | ||
6 | From: Alex Thorlton <athorlton@sgi.com> | |
7 | ||
8 | commit f72075c9eda8a43aeea2f9dbb8d187afd4a76f0b upstream. | |
9 | ||
10 | This problem has actually been in the UV code for a while, but we didn't | |
11 | catch it until recently, because we had been relying on EFI_OLD_MEMMAP | |
12 | to allow our systems to boot for a period of time. We noticed the issue | |
13 | when trying to kexec a recent community kernel, where we hit this NULL | |
14 | pointer dereference in efi_sync_low_kernel_mappings(): | |
15 | ||
16 | [ 0.337515] BUG: unable to handle kernel NULL pointer dereference at 0000000000000880 | |
17 | [ 0.346276] IP: [<ffffffff8105df8d>] efi_sync_low_kernel_mappings+0x5d/0x1b0 | |
18 | ||
19 | The problem doesn't show up with EFI_OLD_MEMMAP because we skip the | |
20 | chunk of setup_efi_state() that sets the efi_loader_signature for the | |
21 | kexec'd kernel. When the kexec'd kernel boots, it won't set EFI_BOOT in | |
22 | setup_arch, so we completely avoid the bug. | |
23 | ||
24 | We always kexec with noefi on the command line, so this shouldn't be an | |
25 | issue, but since we're not actually checking for efi_runtime_disabled in | |
26 | uv_bios_init(), we end up trying to do EFI runtime callbacks when we | |
27 | shouldn't be. This patch just adds a check for efi_runtime_disabled in | |
28 | uv_bios_init() so that we don't map in uv_systab when runtime_disabled == | |
29 | true. | |
30 | ||
31 | Signed-off-by: Alex Thorlton <athorlton@sgi.com> | |
32 | Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> | |
33 | Cc: Andy Lutomirski <luto@kernel.org> | |
34 | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> | |
35 | Cc: Borislav Petkov <bp@alien8.de> | |
36 | Cc: Borislav Petkov <bp@suse.de> | |
37 | Cc: Brian Gerst <brgerst@gmail.com> | |
38 | Cc: Denys Vlasenko <dvlasenk@redhat.com> | |
39 | Cc: H. Peter Anvin <hpa@zytor.com> | |
40 | Cc: Josh Poimboeuf <jpoimboe@redhat.com> | |
41 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
42 | Cc: Mike Travis <travis@sgi.com> | |
43 | Cc: Peter Zijlstra <peterz@infradead.org> | |
44 | Cc: Russ Anderson <rja@sgi.com> | |
45 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
46 | Cc: linux-efi@vger.kernel.org | |
47 | Link: http://lkml.kernel.org/r/1470912120-22831-2-git-send-email-matt@codeblueprint.co.uk | |
48 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
49 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
50 | ||
51 | --- | |
52 | arch/x86/platform/uv/bios_uv.c | 3 ++- | |
53 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
54 | ||
55 | --- a/arch/x86/platform/uv/bios_uv.c | |
56 | +++ b/arch/x86/platform/uv/bios_uv.c | |
57 | @@ -188,7 +188,8 @@ EXPORT_SYMBOL_GPL(uv_bios_set_legacy_vga | |
58 | void uv_bios_init(void) | |
59 | { | |
60 | uv_systab = NULL; | |
61 | - if ((efi.uv_systab == EFI_INVALID_TABLE_ADDR) || !efi.uv_systab) { | |
62 | + if ((efi.uv_systab == EFI_INVALID_TABLE_ADDR) || | |
63 | + !efi.uv_systab || efi_runtime_disabled()) { | |
64 | pr_crit("UV: UVsystab: missing\n"); | |
65 | return; | |
66 | } |