Skip to content

Commit e0c0fc1

Browse files
VincentZWCpaul-walmsley-sifive
authored andcommitted
riscv: avoid sending a SIGTRAP to a user thread trapped in WARN()
On RISC-V, when the kernel runs code on behalf of a user thread, and the kernel executes a WARN() or WARN_ON(), the user thread will be sent a bogus SIGTRAP. Fix the RISC-V kernel code to not send a SIGTRAP when a WARN()/WARN_ON() is executed. Signed-off-by: Vincent Chen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> [[email protected]: fixed subject] Signed-off-by: Paul Walmsley <[email protected]>
1 parent 8b04825 commit e0c0fc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs)
134134
break;
135135
case BUG_TRAP_TYPE_WARN:
136136
regs->sepc += get_break_insn_length(regs->sepc);
137-
break;
137+
return;
138138
case BUG_TRAP_TYPE_BUG:
139139
#endif /* CONFIG_GENERIC_BUG */
140140
default:

0 commit comments

Comments
 (0)