Skip to content

Commit

Permalink
Merge tag 'csky-for-linus-6.5' of https://github.com/c-sky/csky-linux
Browse files Browse the repository at this point in the history
Pull arch/csky update from Guo Ren:

 - Correct thread.trap_no restore of uprobe

* tag 'csky-for-linus-6.5' of https://github.com/c-sky/csky-linux:
  csky: uprobes: Restore thread.trap_no
  • Loading branch information
Linus Torvalds committed Jul 2, 2023
2 parents dfab92f + dd64621 commit 995b406
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/csky/kernel/probes/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 995b406

Please sign in to comment.