diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-09-08 05:15:55 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-08 05:15:55 -0400 |
commit | 734db3770de03fbe9ae4e78519a7d1678189788c (patch) | |
tree | 592de33e308a1e318281d2af0eec1ce686c5557f /arch | |
parent | 247bc6d2ae3e2de08529977952c7d085f9d562d4 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/kprobes.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sh/kernel/kprobes.c b/arch/sh/kernel/kprobes.c index f0e1c78d0bff..a478ba78e752 100644 --- a/arch/sh/kernel/kprobes.c +++ b/arch/sh/kernel/kprobes.c | |||
@@ -252,6 +252,17 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
252 | p = get_kprobe(addr); | 252 | p = get_kprobe(addr); |
253 | if (!p) { | 253 | if (!p) { |
254 | /* Not one of ours: let kernel handle it */ | 254 | /* Not one of ours: let kernel handle it */ |
255 | if (*(kprobe_opcode_t *)addr != BREAKPOINT_INSTRUCTION) { | ||
256 | /* | ||
257 | * The breakpoint instruction was removed right | ||
258 | * after we hit it. Another cpu has removed | ||
259 | * either a probepoint or a debugger breakpoint | ||
260 | * at this address. In either case, no further | ||
261 | * handling of this interrupt is appropriate. | ||
262 | */ | ||
263 | ret = 1; | ||
264 | } | ||
265 | |||
255 | goto no_kprobe; | 266 | goto no_kprobe; |
256 | } | 267 | } |
257 | 268 | ||