diff options
| author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-12-05 17:09:44 +0000 |
|---|---|---|
| committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-12-10 12:21:46 +0000 |
| commit | 40b466db1dffb41f0529035c59c5739636d0e5b8 (patch) | |
| tree | 9b0f65a6ba0915d30db61ab1ae2699c4d433de3a | |
| parent | dea20281ac88226615761c570c8ff7adc18e6ac2 (diff) | |
ARM: allow __do_kernel_fault() to report execution of memory faults
Allow __do_kernel_fault() to detect the execution of memory, so we can
provide the same fault message as do_page_fault() would do. This is
required when we split the kernel address fault handling from the
main do_page_fault() code path.
Reviewed-by: Xie Yuanbin <xieyuanbin1@huawei.com>
Tested-by: Xie Yuanbin <xieyuanbin1@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
| -rw-r--r-- | arch/arm/mm/fault.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index f87f353e5a8b..192c8ab196db 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -175,6 +175,8 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, */ if (addr < PAGE_SIZE) { msg = "NULL pointer dereference"; + } else if (is_permission_fault(fsr) && fsr & FSR_LNX_PF) { + msg = "execution of memory"; } else { if (is_translation_fault(fsr) && kfence_handle_page_fault(addr, is_write_fault(fsr), regs)) |
