]>
Commit | Line | Data |
---|---|---|
321d628a FG |
1 | From cac8711a9ba742e97090cc5ec522360f1549c584 Mon Sep 17 00:00:00 2001 |
2 | From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> | |
3 | Date: Fri, 29 Sep 2017 17:08:19 +0300 | |
e4cdf2a5 | 4 | Subject: [PATCH 076/241] x86/xen: Provide pre-built page tables only for |
321d628a FG |
5 | CONFIG_XEN_PV=y and CONFIG_XEN_PVH=y |
6 | MIME-Version: 1.0 | |
7 | Content-Type: text/plain; charset=UTF-8 | |
8 | Content-Transfer-Encoding: 8bit | |
9 | ||
10 | CVE-2017-5754 | |
11 | ||
12 | Looks like we only need pre-built page tables in the CONFIG_XEN_PV=y and | |
13 | CONFIG_XEN_PVH=y cases. | |
14 | ||
15 | Let's not provide them for other configurations. | |
16 | ||
17 | Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | |
18 | Reviewed-by: Juergen Gross <jgross@suse.com> | |
19 | Cc: Andrew Morton <akpm@linux-foundation.org> | |
20 | Cc: Andy Lutomirski <luto@amacapital.net> | |
21 | Cc: Borislav Petkov <bp@suse.de> | |
22 | Cc: Cyrill Gorcunov <gorcunov@openvz.org> | |
23 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
24 | Cc: Peter Zijlstra <peterz@infradead.org> | |
25 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
26 | Cc: linux-mm@kvack.org | |
27 | Link: http://lkml.kernel.org/r/20170929140821.37654-5-kirill.shutemov@linux.intel.com | |
28 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
29 | (cherry picked from commit 4375c29985f155d7eb2346615d84e62d1b673682) | |
30 | Signed-off-by: Andy Whitcroft <apw@canonical.com> | |
31 | Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> | |
32 | (cherry picked from commit a883ee7f3c1dc64a8c946543ac598399353d1b03) | |
33 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
34 | --- | |
35 | arch/x86/kernel/head_64.S | 11 ++++++----- | |
36 | 1 file changed, 6 insertions(+), 5 deletions(-) | |
37 | ||
38 | diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S | |
39 | index d081bc7a027d..12daaa0b187f 100644 | |
40 | --- a/arch/x86/kernel/head_64.S | |
41 | +++ b/arch/x86/kernel/head_64.S | |
42 | @@ -37,11 +37,12 @@ | |
43 | * | |
44 | */ | |
45 | ||
46 | -#define p4d_index(x) (((x) >> P4D_SHIFT) & (PTRS_PER_P4D-1)) | |
47 | #define pud_index(x) (((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | |
48 | ||
49 | +#if defined(CONFIG_XEN_PV) || defined(CONFIG_XEN_PVH) | |
50 | PGD_PAGE_OFFSET = pgd_index(__PAGE_OFFSET_BASE) | |
51 | PGD_START_KERNEL = pgd_index(__START_KERNEL_map) | |
52 | +#endif | |
53 | L3_START_KERNEL = pud_index(__START_KERNEL_map) | |
54 | ||
55 | .text | |
56 | @@ -348,10 +349,7 @@ NEXT_PAGE(early_dynamic_pgts) | |
57 | ||
58 | .data | |
59 | ||
60 | -#ifndef CONFIG_XEN | |
61 | -NEXT_PAGE(init_top_pgt) | |
62 | - .fill 512,8,0 | |
63 | -#else | |
64 | +#if defined(CONFIG_XEN_PV) || defined(CONFIG_XEN_PVH) | |
65 | NEXT_PAGE(init_top_pgt) | |
66 | .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE | |
67 | .org init_top_pgt + PGD_PAGE_OFFSET*8, 0 | |
68 | @@ -368,6 +366,9 @@ NEXT_PAGE(level2_ident_pgt) | |
69 | * Don't set NX because code runs from these pages. | |
70 | */ | |
71 | PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD) | |
72 | +#else | |
73 | +NEXT_PAGE(init_top_pgt) | |
74 | + .fill 512,8,0 | |
75 | #endif | |
76 | ||
77 | #ifdef CONFIG_X86_5LEVEL | |
78 | -- | |
79 | 2.14.2 | |
80 |