summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2026-06-22 12:26:32 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-04 13:41:28 +0200
commita36d4459bb73172b4a1d4023c3c70af416632380 (patch)
tree5852af79fbd795e8db179b62b03117d19ef85c1f
parent0492a51d02a8d6b85e034660bd7fe206c16cf069 (diff)
downloadlinux-stable-a36d4459bb73172b4a1d4023c3c70af416632380.tar.gz
linux-stable-a36d4459bb73172b4a1d4023c3c70af416632380.zip
ARM: allow __do_kernel_fault() to report execution of memory faults
commit 40b466db1dffb41f0529035c59c5739636d0e5b8 upstream 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> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/arm/mm/fault.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 2315d40760a7..c94633eb64a1 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -172,6 +172,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))