lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86/mm: keep __default_kernel_pte_mask in sync with __supported_pte_mask
Date
Both masks get applied in the process of e.g. set_fixmap() - the former
through use of PAGE_KERNEL, the latter by use of massage_pgprot(). Hence
forever since the introduction of the former there was a time window
(between x86_configure_nx() and the syncing of the two in
probe_page_size_mask(), as called from init_mem_mapping()) where fixmap
mappings would get established without NX set. For a 32-bit kernel
running in PV mode under Xen this meant a W+X mapping (and associated
warning) for its shared info page mapping established in
xen_pv_init_platform().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/arch/x86/mm/setup_nx.c
+++ b/arch/x86/mm/setup_nx.c
@@ -33,10 +33,13 @@ early_param("noexec", noexec_setup);

void x86_configure_nx(void)
{
- if (boot_cpu_has(X86_FEATURE_NX) && !disable_nx)
+ if (boot_cpu_has(X86_FEATURE_NX) && !disable_nx) {
__supported_pte_mask |= _PAGE_NX;
- else
+ __default_kernel_pte_mask |= _PAGE_NX;
+ } else {
__supported_pte_mask &= ~_PAGE_NX;
+ __default_kernel_pte_mask &= ~_PAGE_NX;
+ }
}

void __init x86_report_nx(void)
\
 
 \ /
  Last update: 2020-05-27 17:54    [W:1.269 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site