kprobes: Do not increment probe miss count in the fault handler
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tue, 1 Jun 2021 12:01:50 +0000 (17:31 +0530)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 3 Jun 2021 13:47:26 +0000 (15:47 +0200)
commit2e38eb04c95e5546b71bb86ee699a891c7d212b5
tree08bd6a3a4294516dcfbd5b327fc50e65948fb22e
parent00afe83098f59d3091a800d0db188ca495b2bc02
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
arch/arc/kernel/kprobes.c
arch/arm/probes/kprobes/core.c
arch/arm64/kernel/probes/kprobes.c
arch/csky/kernel/probes/kprobes.c
arch/ia64/kernel/kprobes.c
arch/powerpc/kernel/kprobes.c
arch/riscv/kernel/probes/kprobes.c
arch/s390/kernel/kprobes.c
arch/sh/kernel/kprobes.c
arch/sparc/kernel/kprobes.c
arch/x86/kernel/kprobes/core.c