x86: correctly handle NX and RW bit testing
Status from this message: The following commit has been merged into the x86/mm branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Changes in v2 from the cover letter
- split the patch into multiple patches
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | x86/pat: introduce lookup_address_in_pgd_attr()arch/ arch/ | +32 | 0 replies | |
| 2/4 | x86/mm: use lookup_address_in_pgd_attr() in show_fault_oops()arch/ | +4 | 0 replies | |
| 3/4 | x86/pat: restructure _lookup_address_cpa()arch/ | +7 | 0 replies | |
| 4/4 | x86/pat: fix W^X violation false-positives when running as Xen PV guestarch/ | +18 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/4] x86: correctly handle NX and RW bit testing
When the processor is detecting a set NX bit on any page table level when doing a page table walk, the resulting page will not be suitable for code execution.
A similar approach is taken for the RW bit: all page table levels need to have the RW bit set in order to result in a writable page.
Unfortunately the kernel is only looking at the leaf page table entry for deciding whether e.g. a writable page is executable or not.
Fix that by calculating the effective NX and RW bits over all page table levels when doing a software address lookup, mimicking the hardware behavior.
Changes in V2:
- split the patch into multiple patches
Juergen Gross (4):
x86/pat: introduce lookup_address_in_pgd_attr() x86/mm: use lookup_address_in_pgd_attr() in show_fault_oops() x86/pat: restructure _lookup_address_cpa()
x86/pat: fix W^X violation false-positives when running as Xen PV
guest
arch/x86/include/asm/pgtable_types.h | 2 + arch/x86/mm/fault.c | 7 +-- arch/x86/mm/pat/set_memory.c | 68 ++++++++++++++++++++++------ 3 files changed, 60 insertions(+), 17 deletions(-)
Signature · 1 line
2.35.3