summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorVincent Chen <vincent.chen@sifive.com>2019-09-23 08:45:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 13:08:24 +0100
commit50fc07843a61a8ea0f72af1490561261dd6254e2 (patch)
tree35e6702426b3f7fff691b636a840f85c937d00f5 /arch
parente449496d23aa20affae2e39c268ec13f0c81e96f (diff)
riscv: avoid sending a SIGTRAP to a user thread trapped in WARN()
[ Upstream commit e0c0fc18f10d5080cddde0e81505fd3e952c20c4 ] 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 <vincent.chen@sifive.com> Reviewed-by: Christoph Hellwig <hch@lst.de> [paul.walmsley@sifive.com: fixed subject] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/kernel/traps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index 055a937aca70..82f42a55451e 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -134,7 +134,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs)
break;
case BUG_TRAP_TYPE_WARN:
regs->sepc += get_break_insn_length(regs->sepc);
- break;
+ return;
case BUG_TRAP_TYPE_BUG:
#endif /* CONFIG_GENERIC_BUG */
default: