]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/kprobes.c
[PATCH] kprobes: fix race in recovery of reentrant probe
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / kprobes.c
index ff5e9d5cad50ed7f2507f3c9a1935e518d34d937..b9a9ce70e55c1f281ff4759b47abc6d03e10ae49 100644 (file)
@@ -135,6 +135,14 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
                        prepare_singlestep(p, regs, kcb);
                        return 1;
                } else {
+                       if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) {
+                       /* The breakpoint instruction was removed by
+                        * another cpu right after we hit, no further
+                        * handling of this interrupt is appropriate
+                        */
+                               ret = 1;
+                               goto no_kprobe;
+                       }
                        p = __get_cpu_var(current_kprobe);
                        if (p->break_handler && p->break_handler(p, regs))
                                goto ss_probe;