author: Tiezhu Yang <yangtiezhu@loongson.cn> 2023-04-23 09:42:26 +0800
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:36:16 +0200
commit: 489026d57a3c38c23e581780bbea66a0a5d7a369
parent: 616464ae2e17072ef3265bb11d9babfcbb4c730d
Commit Summary:
Diffstat:
1 file changed, 2 insertions, 0 deletions
diff --git a/arch/riscv/kernel/probes/uprobes.c b/arch/riscv/kernel/probes/uprobes.c
index c976a21cd4bd..194f166b2cc4 100644
--- a/arch/riscv/kernel/probes/uprobes.c
+++ b/arch/riscv/kernel/probes/uprobes.c
@@ -67,6 +67,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
struct uprobe_task *utask = current->utask;
WARN_ON_ONCE(current->thread.bad_cause != UPROBE_TRAP_NR);
+ current->thread.bad_cause = utask->autask.saved_cause;
instruction_pointer_set(regs, utask->vaddr + auprobe->insn_size);
@@ -102,6 +103,7 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
{
struct uprobe_task *utask = current->utask;
+ current->thread.bad_cause = utask->autask.saved_cause;
/*
* Task has received a fatal signal, so reset back to probbed
* address.