Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf8d5c52 authored by Keshavamurthy Anil S's avatar Keshavamurthy Anil S Committed by Linus Torvalds
Browse files

[PATCH] kprobes: increment kprobe missed count for multiprobes



When multiple probes are registered at the same address and if due to some
recursion (probe getting triggered within a probe handler), we skip calling
pre_handlers and just increment nmissed field.

The below patch make sure it walks the list for multiple probes case.
Without the below patch we get incorrect results of nmissed count for
multiple probe case.

Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 00d7c05a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
			 */
			save_previous_kprobe(kcb);
			set_current_kprobe(p, regs, kcb);
			p->nmissed++;
			kprobes_inc_nmissed_count(p);
			prepare_singlestep(p, regs);
			kcb->kprobe_status = KPROBE_REENTER;
			return 1;
+1 −1
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
			 */
			save_previous_kprobe(kcb);
			set_current_kprobe(p, kcb);
			p->nmissed++;
			kprobes_inc_nmissed_count(p);
			prepare_ss(p, regs);
			kcb->kprobe_status = KPROBE_REENTER;
			return 1;
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ static inline int kprobe_handler(struct pt_regs *regs)
			save_previous_kprobe(kcb);
			set_current_kprobe(p, regs, kcb);
			kcb->kprobe_saved_msr = regs->msr;
			p->nmissed++;
			kprobes_inc_nmissed_count(p);
			prepare_singlestep(p, regs);
			kcb->kprobe_status = KPROBE_REENTER;
			return 1;
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
			 */
			save_previous_kprobe(kcb);
			set_current_kprobe(p, regs, kcb);
			p->nmissed++;
			kprobes_inc_nmissed_count(p);
			kcb->kprobe_status = KPROBE_REENTER;
			prepare_singlestep(p, regs, kcb);
			return 1;
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
				 */
				save_previous_kprobe(kcb);
				set_current_kprobe(p, regs, kcb);
				p->nmissed++;
				kprobes_inc_nmissed_count(p);
				prepare_singlestep(p, regs);
				kcb->kprobe_status = KPROBE_REENTER;
				return 1;
Loading