Loading arch/arm/Kconfig.debug +12 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,18 @@ config FORCE_PAGES If unsure say N. config FREE_PAGES_RDONLY bool "Set pages as read only while on the buddy list" select FORCE_PAGES select PAGE_POISONING help Pages are always mapped in the kernel. This means that anyone can write to the page if they have the address. Enable this option to mark pages as read only to trigger a fault if any code attempts to write to a page on the buddy list. This may have a performance impact. If unsure, say N. # These options are only for real kernel hackers who want to get their hands dirty. config DEBUG_LL Loading arch/arm/include/asm/cacheflush.h +9 −0 Original line number Diff line number Diff line Loading @@ -539,4 +539,13 @@ static inline void secure_flush_area(const void *addr, size_t size) outer_flush_range(phys, phys + size); } #ifdef CONFIG_FREE_PAGES_RDONLY #define mark_addr_rdonly(a) set_memory_ro((unsigned long)a, 1) #define mark_addr_rdwrite(a) set_memory_rw((unsigned long)a, 1) #else #define mark_addr_rdonly(a) #define mark_addr_rdwrite(a) #endif #endif Loading
arch/arm/Kconfig.debug +12 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,18 @@ config FORCE_PAGES If unsure say N. config FREE_PAGES_RDONLY bool "Set pages as read only while on the buddy list" select FORCE_PAGES select PAGE_POISONING help Pages are always mapped in the kernel. This means that anyone can write to the page if they have the address. Enable this option to mark pages as read only to trigger a fault if any code attempts to write to a page on the buddy list. This may have a performance impact. If unsure, say N. # These options are only for real kernel hackers who want to get their hands dirty. config DEBUG_LL Loading
arch/arm/include/asm/cacheflush.h +9 −0 Original line number Diff line number Diff line Loading @@ -539,4 +539,13 @@ static inline void secure_flush_area(const void *addr, size_t size) outer_flush_range(phys, phys + size); } #ifdef CONFIG_FREE_PAGES_RDONLY #define mark_addr_rdonly(a) set_memory_ro((unsigned long)a, 1) #define mark_addr_rdwrite(a) set_memory_rw((unsigned long)a, 1) #else #define mark_addr_rdonly(a) #define mark_addr_rdwrite(a) #endif #endif