From: <gregkh@linuxfoundation.org>
To: pasha.tatashin@oracle.com, jkosina@suse.cz, steven.sistare@oracle.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "x86/pti/efi: broken conversion from efi to kernel page table" has been added to the 4.9-stable tree
Date: Sat, 13 Jan 2018 14:17:30 +0100 [thread overview]
Message-ID: <1515849450248243@kroah.com> (raw)
In-Reply-To: <20180111215820.29736-1-pasha.tatashin@oracle.com>
This is a note to let you know that I've just added the patch titled
x86/pti/efi: broken conversion from efi to kernel page table
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>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;
Patches currently in stable-queue which might be from pasha.tatashin@oracle.com are
queue-4.9/x86-pti-efi-broken-conversion-from-efi-to-kernel-page-table.patch
next prev parent reply other threads:[~2018-01-13 13:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 21:58 [PATCH 4.9] x86/pti/efi: broken conversion from efi to kernel page table Pavel Tatashin
2018-01-12 13:58 ` Ingo Molnar
2018-01-12 14:09 ` Pavel Tatashin
2018-01-12 14:27 ` Jiri Kosina
2018-01-13 13:16 ` Greg KH
2018-01-13 13:17 ` gregkh [this message]
2018-01-13 13:18 ` Greg KH
2018-01-13 17:12 ` Greg KH
2018-01-13 17:40 ` Pavel Tatashin
2018-01-13 18:14 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2018-01-15 16:44 [PATCH 4.9 v2] " Pavel Tatashin
2018-01-15 17:49 ` Patch "x86/pti/efi: broken conversion from efi to kernel page table" has been added to the 4.9-stable tree gregkh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515849450248243@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jkosina@suse.cz \
--cc=pasha.tatashin@oracle.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=steven.sistare@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.