diff options
author | Juergen Gross <jgross@suse.com> | 2024-04-12 18:12:58 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2024-04-14 23:16:30 +0300 |
commit | 5bc8b0f5dac04cd4ebe47f8090a5942f2f2647ef (patch) | |
tree | 6c835aad11695962260a271f03a9979cab3201cf /arch/x86/include/asm/pgtable_types.h | |
parent | 02eac06b820c3eae73e5736ae62f986d37fed991 (diff) | |
download | linux-5bc8b0f5dac04cd4ebe47f8090a5942f2f2647ef.tar.xz |
x86/pat: Fix W^X violation false-positives when running as Xen PV guest
When running as Xen PV guest in some cases W^X violation WARN()s have
been observed. Those WARN()s are produced by verify_rwx(), which looks
into the PTE to verify that writable kernel pages have the NX bit set
in order to avoid code modifications of the kernel by rogue code.
As the NX bits of all levels of translation entries are or-ed and the
RW bits of all levels are and-ed, looking just into the PTE isn't enough
for the decision that a writable page is executable, too.
When running as a Xen PV guest, the direct map PMDs and kernel high
map PMDs share the same set of PTEs. Xen kernel initialization will set
the NX bit in the direct map PMD entries, and not the shared PTEs.
Fixes: 652c5bf380ad ("x86/mm: Refuse W^X violations")
Reported-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240412151258.9171-5-jgross@suse.com
Diffstat (limited to 'arch/x86/include/asm/pgtable_types.h')
0 files changed, 0 insertions, 0 deletions