Skip to content

Commit

Permalink
sh: kprobes: Fix up race against probe point removal.
Browse files Browse the repository at this point in the history
Handle a corner case where another CPU or debugger removes the probe
point from underneath us.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Sep 8, 2008
1 parent 247bc6d commit 734db37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/sh/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
p = get_kprobe(addr);
if (!p) {
/* Not one of ours: let kernel handle it */
if (*(kprobe_opcode_t *)addr != BREAKPOINT_INSTRUCTION) {
/*
* The breakpoint instruction was removed right
* after we hit it. Another cpu has removed
* either a probepoint or a debugger breakpoint
* at this address. In either case, no further
* handling of this interrupt is appropriate.
*/
ret = 1;
}

goto no_kprobe;
}

Expand Down

0 comments on commit 734db37

Please sign in to comment.