Skip to content

Commit 40b466d

Browse files
author
Russell King (Oracle)
committed
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>
1 parent dea2028 commit 40b466d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/arm/mm/fault.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
175175
*/
176176
if (addr < PAGE_SIZE) {
177177
msg = "NULL pointer dereference";
178+
} else if (is_permission_fault(fsr) && fsr & FSR_LNX_PF) {
179+
msg = "execution of memory";
178180
} else {
179181
if (is_translation_fault(fsr) &&
180182
kfence_handle_page_fault(addr, is_write_fault(fsr), regs))

0 commit comments

Comments
 (0)