This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix kprobes handling of simultaneous probe hit/unregister


This patch fixes a bug in kprobes's handling of a corner case on i386
and x86_64.  On an SMP system, if one CPU unregisters a kprobe just
after another CPU hits that probepoint, kprobe_handler() on the latter
CPU sees that the kprobe has been unregistered, and attempts to let the
CPU continue as if the probepoint hadn't been hit.  The bug is that on
i386 and x86_64, we were neglecting to set the IP back to the beginning
of the probed instruction.  This could cause an oops or crash.

This bug doesn't exist on ppc64 and ia64, where a breakpoint
instruction leaves the IP pointing to the beginning of the instruction.
I don't know about sparc64.  (Dave, could you please advise?)

This fix has been tested on i386 and x86_64 SMP systems.  To reproduce
the problem, set one CPU to work registering and unregistering a kprobe
repeatedly, and another CPU pounding the probepoint in a tight loop.

Please apply.

Acked-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>

Attachment: kprobes_unregister_fix.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]