Skip to content

Commit dd64621

Browse files
seehearfeelguoren83
authored andcommitted
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>
1 parent ac9a786 commit dd64621

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/csky/kernel/probes/uprobes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
6464
struct uprobe_task *utask = current->utask;
6565

6666
WARN_ON_ONCE(current->thread.trap_no != UPROBE_TRAP_NR);
67+
current->thread.trap_no = utask->autask.saved_trap_no;
6768

6869
instruction_pointer_set(regs, utask->vaddr + auprobe->insn_size);
6970

@@ -101,6 +102,8 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
101102
{
102103
struct uprobe_task *utask = current->utask;
103104

105+
current->thread.trap_no = utask->autask.saved_trap_no;
106+
104107
/*
105108
* Task has received a fatal signal, so reset back to probed
106109
* address.

0 commit comments

Comments
 (0)