x86/mm: Inhibit _PAGE_NX changes from cpa_process_alias()
authorPeter Zijlstra <peterz@infradead.org>
Thu, 10 Nov 2022 12:33:57 +0000 (13:33 +0100)
committerDave Hansen <dave.hansen@linux.intel.com>
Thu, 15 Dec 2022 18:37:28 +0000 (10:37 -0800)
commitd597416683d587e940faa35945fba162329b5a71
tree55e54e146b9de6c380a6ec047111e56eb9b003af
parentef9ab81af6e1f7b7ff589aa1504434aa5915c1df
x86/mm: Inhibit _PAGE_NX changes from cpa_process_alias()

There is a cludge in change_page_attr_set_clr() that inhibits
propagating NX changes to the aliases (directmap and highmap) -- this
is a cludge twofold:

 - it also inhibits the primary checks in __change_page_attr();
 - it hard depends on single bit changes.

The introduction of set_memory_rox() triggered this last issue for
clearing both _PAGE_RW and _PAGE_NX.

Explicitly ignore _PAGE_NX in cpa_process_alias() instead.

Fixes: b38994948567 ("x86/mm: Implement native set_memory_rox()")
Reported-by: kernel test robot <oliver.sang@intel.com>
Debugged-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221110125544.594991716%40infradead.org
arch/x86/mm/pat/set_memory.c