mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH] x86/mm: Mask out unsupported bit when it set noexec=off
@ 2019-11-11  9:53 zhong jiang
  2019-11-11 23:32 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2019-11-11  9:53 UTC (permalink / raw)
  To: dave.hansen, peterz, tglx, mingo
  Cc: luto, bp, hpa, zhongjiang, x86, linux-kernel

Commit 510bb96fe5b3 ("x86/mm: Prevent bogus warnings with "noexec=off"")
use  __supported_pte_mask to replace __default_kernel_pte_mask to mask
out the unsupported bits. It works when the command line set noexec=off.

It also seems to works to use __supported_pte_mask instead in native_set_fixmap.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 arch/x86/mm/pgtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 7bd2c3a..13933b9 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -647,7 +647,7 @@ void native_set_fixmap(unsigned /* enum fixed_addresses */ idx,
 		       phys_addr_t phys, pgprot_t flags)
 {
 	/* Sanitize 'prot' against any unsupported bits: */
-	pgprot_val(flags) &= __default_kernel_pte_mask;
+	pgprot_val(flags) &= __supported_pte_mask;
 
 	__native_set_fixmap(idx, pfn_pte(phys >> PAGE_SHIFT, flags));
 }
-- 
1.7.12.4


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

end of thread, other threads:[~2019-11-11 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11  9:53 [RFC PATCH] x86/mm: Mask out unsupported bit when it set noexec=off zhong jiang
2019-11-11 23:32 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®