diff options
author | Laura Abbott <labbott@redhat.com> | 2016-10-27 18:27:34 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-11-07 19:15:04 +0100 |
commit | 1404d6f13e47c42f155e3c6a611b1bf4dd35dde9 (patch) | |
tree | f6bf9d56920d2c3d7346cd925781b071075c810b /arch/arm64/mm/mmu.c | |
parent | arm64: dump: Remove max_addr (diff) | |
download | linux-1404d6f13e47c42f155e3c6a611b1bf4dd35dde9.tar.xz linux-1404d6f13e47c42f155e3c6a611b1bf4dd35dde9.zip |
arm64: dump: Add checking for writable and exectuable pages
Page mappings with full RWX permissions are a security risk. x86
has an option to walk the page tables and dump any bad pages.
(See e1a58320a38d ("x86/mm: Warn on W^X mappings")). Add a similar
implementation for arm64.
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[catalin.marinas@arm.com: folded fix for KASan out of bounds from Mark Rutland]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to '')
-rw-r--r-- | arch/arm64/mm/mmu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index dd5f12d0959e..17243e43184e 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -40,6 +40,7 @@ #include <asm/tlb.h> #include <asm/memblock.h> #include <asm/mmu_context.h> +#include <asm/ptdump.h> u64 idmap_t0sz = TCR_T0SZ(VA_BITS); @@ -438,6 +439,8 @@ void mark_rodata_ro(void) /* flush the TLBs after updating live kernel mappings */ flush_tlb_all(); + + debug_checkwx(); } static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end, |