[PATCH] LoongArch: Change the signal return for user-mode ADE exceptions

Chenghao Duan posted 1 patch 6 days, 13 hours ago
arch/loongarch/kernel/traps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] LoongArch: Change the signal return for user-mode ADE exceptions
Posted by Chenghao Duan 6 days, 13 hours ago
When a user-mode process accesses an invalid address, the SIGSEGV signal
is returned.
For example, when user-space accesses a kernel-space virtual address.

Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
---
 arch/loongarch/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c
index da5926fead4a..508d3126cdb2 100644
--- a/arch/loongarch/kernel/traps.c
+++ b/arch/loongarch/kernel/traps.c
@@ -537,7 +537,7 @@ asmlinkage void noinstr do_ade(struct pt_regs *regs)
 	irqentry_state_t state = irqentry_enter(regs);
 
 	die_if_kernel("Kernel ade access", regs);
-	force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)regs->csr_badvaddr);
+	force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)regs->csr_badvaddr);
 
 	irqentry_exit(regs, state);
 }
-- 
2.25.1