]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/x86/kernel/kprobes.c
tracing/kprobes: Dump the culprit kprobe in case of kprobe recursion
[mirror_ubuntu-zesty-kernel.git] / arch / x86 / kernel / kprobes.c
index 16ae9610f6ffb51b1d47180360da71c0ba0fd33a..ecee3d23fef8d622d52165fd1dffe26d3af6459f 100644 (file)
@@ -490,9 +490,13 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
                        /* A probe has been hit in the codepath leading up
                         * to, or just after, single-stepping of a probed
                         * instruction. This entire codepath should strictly
-                        * reside in .kprobes.text section. Raise a warning
-                        * to highlight this peculiar case.
+                        * reside in .kprobes.text section.
+                        * Raise a BUG or we'll continue in an endless
+                        * reentering loop and eventually a stack overflow.
                         */
+                       arch_disarm_kprobe(p);
+                       dump_kprobe(p);
+                       BUG();
                }
        default:
                /* impossible cases */