From: Joerg Roedel <joro@8bytes.org>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>
Cc: hpa@zytor.com, Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@suse.de>,
linux-kernel@vger.kernel.org, Joerg Roedel <jroedel@suse.de>,
Dave Hansen <dave.hansen@linux.intel.com>
Subject: [PATCH] x86/ldt: Fix support_pte_mask filtering in map_ldt_struct()
Date: Mon, 16 Apr 2018 11:43:57 +0200 [thread overview]
Message-ID: <1523871837-8378-1-git-send-email-joro@8bytes.org> (raw)
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
next reply other threads:[~2018-04-16 9:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 9:43 Joerg Roedel [this message]
2018-04-16 15:16 ` [PATCH] x86/ldt: Fix support_pte_mask filtering in map_ldt_struct() 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
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=1523871837-8378-1-git-send-email-joro@8bytes.org \
--to=joro@8bytes.org \
--cc=bp@suse.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 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).