aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/kprobes
diff options
context:
space:
mode:
authorGravatar Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> 2021-06-01 17:31:50 +0530
committerGravatar Peter Zijlstra <peterz@infradead.org> 2021-06-03 15:47:26 +0200
commit2e38eb04c95e5546b71bb86ee699a891c7d212b5 (patch)
tree08bd6a3a4294516dcfbd5b327fc50e65948fb22e /arch/x86/kernel/kprobes
parentx86,kprobes: WARN if kprobes tries to handle a fault (diff)
downloadlinux-2e38eb04c95e5546b71bb86ee699a891c7d212b5.tar.gz
linux-2e38eb04c95e5546b71bb86ee699a891c7d212b5.tar.bz2
linux-2e38eb04c95e5546b71bb86ee699a891c7d212b5.zip
kprobes: Do not increment probe miss count in the fault handler
Kprobes has a counter 'nmissed', that is used to count the number of times a probe handler was not called. This generally happens when we hit a kprobe while handling another kprobe. However, if one of the probe handlers causes a fault, we are currently incrementing 'nmissed'. The comment in fault handler indicates that this can be used to account faults taken by the probe handlers. But, this has never been the intention as is evident from the comment above 'nmissed' in 'struct kprobe': /*count the number of times this probe was temporarily disarmed */ unsigned long nmissed; Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lkml.kernel.org/r/20210601120150.672652-1-naveen.n.rao@linux.vnet.ibm.com
Diffstat (limited to 'arch/x86/kernel/kprobes')
-rw-r--r--arch/x86/kernel/kprobes/core.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index cfcdf4b8a306..1b3fe0edd329 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -1102,14 +1102,6 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
restore_previous_kprobe(kcb);
else
reset_current_kprobe();
- } else if (kcb->kprobe_status == KPROBE_HIT_ACTIVE ||
- kcb->kprobe_status == KPROBE_HIT_SSDONE) {
- /*
- * We increment the nmissed count for accounting,
- * we can also use npre/npostfault count for accounting
- * these specific fault cases.
- */
- kprobes_inc_nmissed_count(cur);
}
return 0;