[PATCH] kprobes: fix race in recovery of reentrant probe
There is a window where a probe gets removed right after the probe is hit on some different cpu. In this case probe handlers can't find a matching probe instance related to break address. In this case we need to read the original instruction at break address to see if that is not a break/int3 instruction and recover safely. Previous code had a bug where we were not checking for the above race in case of reentrant probes and the below patch fixes this race. Tested on IA64, Powerpc, x86_64. Signed-off-by:Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
Showing
- arch/i386/kernel/kprobes.c 13 additions, 0 deletionsarch/i386/kernel/kprobes.c
- arch/ia64/kernel/kprobes.c 7 additions, 0 deletionsarch/ia64/kernel/kprobes.c
- arch/powerpc/kernel/kprobes.c 12 additions, 0 deletionsarch/powerpc/kernel/kprobes.c
- arch/sparc64/kernel/kprobes.c 8 additions, 0 deletionsarch/sparc64/kernel/kprobes.c
- arch/x86_64/kernel/kprobes.c 9 additions, 0 deletionsarch/x86_64/kernel/kprobes.c
Please register or sign in to comment