Commit 40b466db authored by Russell King (Oracle)'s avatar Russell King (Oracle)
Browse files

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: default avatarXie Yuanbin <xieyuanbin1@huawei.com>
Tested-by: default avatarXie Yuanbin <xieyuanbin1@huawei.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
parent dea20281
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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))