parisc: Add KFENCE support
Subsystems (2)
Helge Deller
maintainerSigned-off-by Helge Deller <[email protected]>
---
arch/parisc/Kconfig +3 -2
@@ -47,6 +47,7 @@ config PARISC select HAVE_ARCH_HASH select HAVE_ARCH_JUMP_LABEL select HAVE_ARCH_JUMP_LABEL_RELATIVE + select HAVE_ARCH_KFENCE select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_TRACEHOOK select HAVE_REGS_AND_STACK_ACCESS_API
@@ -257,11 +258,11 @@ config PARISC_PAGE_SIZE_4KB config PARISC_PAGE_SIZE_16KB bool "16KB" - depends on PA8X00 && BROKEN + depends on PA8X00 && BROKEN && !KFENCE config PARISC_PAGE_SIZE_64KB bool "64KB" - depends on PA8X00 && BROKEN + depends on PA8X00 && BROKEN && !KFENCE endchoice
arch/parisc/include/asm/kfence.h new file +45 -0
45 lines not on this page · raw message
arch/parisc/mm/fault.c +5 -0
@@ -19,6 +19,7 @@#include <linux/uaccess.h> #include <linux/hugetlb.h> #include <linux/perf_event.h> +#include <linux/kfence.h> #include <asm/traps.h>
@@ -416,6 +417,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,return ; } +if (!user_mode (regs) && +kfence_handle_page_fault (address, flags &FAULT_FLAG_WRITE , regs)) +return ; +parisc_terminate ("Bad Address (null pointer deref?)" , regs, code, address); out_of_memory: