• Prasanna S Panchamukhi's avatar
    [PATCH] kprobes: Temporary disarming of reentrant probe · ea32c65c
    Prasanna S Panchamukhi authored
    In situations where a kprobes handler calls a routine which has a probe on it,
    then kprobes_handler() disarms the new probe forever.  This patch removes the
    above limitation by temporarily disarming the new probe.  When the another
    probe hits while handling the old probe, the kprobes_handler() saves previous
    kprobes state and handles the new probe without calling the new kprobes
    registered handlers.  kprobe_post_handler() restores back the previous kprobes
    state and the normal execution continues.
    
    However on x86_64 architecture, re-rentrancy is provided only through
    pre_handler().  If a routine having probe is referenced through
    post_handler(), then the probes on that routine are disarmed forever, since
    the exception stack is gets changed after the processor single steps the
    instruction of the new probe.
    
    This patch includes generic changes to support temporary disarming on
    reentrancy of probes.
    Signed-of-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    ea32c65c
kprobes.c 12.1 KB