powerpc/mm: Warn if W+X pages found on boot
Implement code to walk all pages and warn if any are found to be both writable and executable. Depends on STRICT_KERNEL_RWX enabled, and is behind the DEBUG_WX config option. This only runs on boot and has no runtime performance implications. Very heavily influenced (and in some cases copied verbatim) from the ARM64 code written by Laura Abbott (thanks!), since our ptdump infrastructure is similar. Signed-off-by: Russell Currey <ruscur@russell.cc> [mpe: Fixup build error when disabled] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
5f18cbdbdd
commit
453d87f6a8
@@ -396,6 +396,9 @@ void mark_rodata_ro(void)
|
||||
PFN_DOWN((unsigned long)__start_rodata);
|
||||
|
||||
change_page_attr(page, numpages, PAGE_KERNEL_RO);
|
||||
|
||||
// mark_initmem_nx() should have already run by now
|
||||
ptdump_check_wx();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user