[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1523871837-8378-1-git-send-email-joro@8bytes.org>
Date: Mon, 16 Apr 2018 11:43:57 +0200
From: Joerg Roedel <joro@...tes.org>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>
Cc: hpa@...or.com, Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...e.de>, linux-kernel@...r.kernel.org,
Joerg Roedel <jroedel@...e.de>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: [PATCH] x86/ldt: Fix support_pte_mask filtering in map_ldt_struct()
From: Joerg Roedel <jroedel@...e.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@...ux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@...e.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
Powered by blists - more mailing lists