mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 00:06:36 +00:00
sh: kprobes: Fix up race against probe point removal.
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>
This commit is contained in:
parent
247bc6d2ae
commit
734db3770d
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue