]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jan 2018 13:17:29 +0000 (14:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jan 2018 13:17:29 +0000 (14:17 +0100)
added patches:
x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch

queue-4.9/series
queue-4.9/x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch [new file with mode: 0644]

index f8450d6c796df1d02c759537533a46d9ad437150..3eb60e42c7e51416a922c546c76543f6e5e811b0 100644 (file)
@@ -40,3 +40,4 @@ ipv6-fix-possible-mem-leaks-in-ipv6_make_skb.patch
 ethtool-do-not-print-warning-for-applications-using-legacy-api.patch
 mlxsw-spectrum_router-fix-null-pointer-deref.patch
 net-sched-fix-update-of-lastuse-in-act-modules-implementing-stats_update.patch
+x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch
diff --git a/queue-4.9/x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch b/queue-4.9/x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch
new file mode 100644 (file)
index 0000000..f2ecdd8
--- /dev/null
@@ -0,0 +1,55 @@
+From pasha.tatashin@oracle.com  Sat Jan 13 14:16:28 2018
+From: Pavel Tatashin <pasha.tatashin@oracle.com>
+Date: Thu, 11 Jan 2018 16:58:20 -0500
+Subject: x86/pti/efi: broken conversion from efi to kernel page table
+To: steven.sistare@oracle.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, gregkh@linuxfoundation.org, jkosina@suse.cz, hughd@google.com, dave.hansen@linux.intel.com, luto@kernel.org, torvalds@linux-foundation.org
+Message-ID: <20180111215820.29736-1-pasha.tatashin@oracle.com>
+
+From: Pavel Tatashin <pasha.tatashin@oracle.com>
+
+The page table order must be increased for EFI table in order to avoid a
+bug where NMI tries to change the page table to kernel page table, while
+efi page table is active.
+
+For more disccussion about this bug, see this thread:
+http://lkml.iu.edu/hypermail/linux/kernel/1801.1/00951.html
+
+Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
+Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
+Acked-by: Jiri Kosina <jkosina@suse.cz>
+---
+ arch/x86/include/asm/pgalloc.h |   11 +++++++++++
+ arch/x86/platform/efi/efi_64.c |    2 +-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/include/asm/pgalloc.h
++++ b/arch/x86/include/asm/pgalloc.h
+@@ -27,6 +27,17 @@ static inline void paravirt_release_pud(
+  */
+ extern gfp_t __userpte_alloc_gfp;
++#ifdef CONFIG_PAGE_TABLE_ISOLATION
++/*
++ * Instead of one PGD, we acquire two PGDs.  Being order-1, it is
++ * both 8k in size and 8k-aligned.  That lets us just flip bit 12
++ * in a pointer to swap between the two 4k halves.
++ */
++#define PGD_ALLOCATION_ORDER 1
++#else
++#define PGD_ALLOCATION_ORDER 0
++#endif
++
+ /*
+  * Allocate and free page tables.
+  */
+--- a/arch/x86/platform/efi/efi_64.c
++++ b/arch/x86/platform/efi/efi_64.c
+@@ -142,7 +142,7 @@ int __init efi_alloc_page_tables(void)
+               return 0;
+       gfp_mask = GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO;
+-      efi_pgd = (pgd_t *)__get_free_page(gfp_mask);
++      efi_pgd = (pgd_t *)__get_free_pages(gfp_mask, PGD_ALLOCATION_ORDER);
+       if (!efi_pgd)
+               return -ENOMEM;