LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] x86/ldt: Fix support_pte_mask filtering in map_ldt_struct()
@ 2018-04-16  9:43 Joerg Roedel
  2018-04-16 15:16 ` Andy Lutomirski
  0 siblings, 1 reply; 10+ messages in thread
From: Joerg Roedel @ 2018-04-16  9:43 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar
  Cc: hpa, Andy Lutomirski, Peter Zijlstra, Borislav Petkov,
	linux-kernel, Joerg Roedel, Dave Hansen

From: Joerg Roedel <jroedel@suse.de>

The |= operator will let us end up with an invalid PTE. Use
the correct &= instead.

Fixes: fb43d6cb91ef ('x86/mm: Do not auto-massage page protections')
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 arch/x86/kernel/ldt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index d41d896481b8..c9b14020f4dd 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -166,7 +166,7 @@ map_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt, int slot)
 		 */
 		pte_prot = __pgprot(__PAGE_KERNEL_RO & ~_PAGE_GLOBAL);
 		/* Filter out unsuppored __PAGE_KERNEL* bits: */
-		pgprot_val(pte_prot) |= __supported_pte_mask;
+		pgprot_val(pte_prot) &= __supported_pte_mask;
 		pte = pfn_pte(pfn, pte_prot);
 		set_pte_at(mm, va, ptep, pte);
 		pte_unmap_unlock(ptep, ptl);
-- 
2.13.6

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-19 19:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16  9:43 [PATCH] x86/ldt: Fix support_pte_mask filtering in map_ldt_struct() Joerg Roedel
2018-04-16 15:16 ` Andy Lutomirski
2018-04-16 15:39   ` Dave Hansen
2018-04-18 12:18     ` Borislav Petkov
2018-04-19 13:00       ` Borislav Petkov
2018-04-19 14:11         ` Joerg Roedel
2018-04-19 14:58           ` Michal Kubecek
2018-04-19 15:11             ` Joerg Roedel
2018-04-19 16:04               ` Borislav Petkov
2018-04-19 19:22           ` Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).