summaryrefslogtreecommitdiffstats
path: root/arch/csky
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2023-04-23 03:39:47 +0200
committerGuo Ren <guoren@linux.alibaba.com>2023-06-18 14:37:27 +0200
commitdd64621a2a97798d5df40028238a703d4324036b (patch)
tree7c694cda668d0197a500285dd16cafb9ddd9c8c7 /arch/csky
parentLinux 6.4-rc1 (diff)
downloadlinux-dd64621a2a97798d5df40028238a703d4324036b.tar.xz
linux-dd64621a2a97798d5df40028238a703d4324036b.zip
csky: uprobes: Restore thread.trap_no
thread.trap_no is saved in arch_uprobe_pre_xol(), it should be restored in arch_uprobe_{post,abort}_xol() accordingly, otherwise the save operation is meaningless, this change is similar with x86 and powerpc. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Acked-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Guo Ren <guoren@kernel.org> Signed-off-by: Guo Ren <guoren@kernel.org>
Diffstat (limited to 'arch/csky')
-rw-r--r--arch/csky/kernel/probes/uprobes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/csky/kernel/probes/uprobes.c b/arch/csky/kernel/probes/uprobes.c
index 2d31a12e46cf..936bea6fd32d 100644
--- a/arch/csky/kernel/probes/uprobes.c
+++ b/arch/csky/kernel/probes/uprobes.c
@@ -64,6 +64,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.trap_no != UPROBE_TRAP_NR);
+ current->thread.trap_no = utask->autask.saved_trap_no;
instruction_pointer_set(regs, utask->vaddr + auprobe->insn_size);
@@ -101,6 +102,8 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
{
struct uprobe_task *utask = current->utask;
+ current->thread.trap_no = utask->autask.saved_trap_no;
+
/*
* Task has received a fatal signal, so reset back to probed
* address.