mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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:
parent
5f18cbdbdd
commit
453d87f6a8
5 changed files with 73 additions and 1 deletions
|
@ -105,6 +105,12 @@ void mark_initmem_nx(void);
|
|||
static inline void mark_initmem_nx(void) { }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC_DEBUG_WX
|
||||
void ptdump_check_wx(void);
|
||||
#else
|
||||
static inline void ptdump_check_wx(void) { }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When used, PTE_FRAG_NR is defined in subarch pgtable.h
|
||||
* so we are sure it is included when arriving here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue