• Roland McGrath's avatar
    [PATCH] x86: further EFLAGS and ptrace cleanups/fixes · 256aa113
    Roland McGrath authored
    This patch further cleans up the appearance of TF in eflags when ptrace is
    involved.  With this, PTRACE_SINGLESTEP will not cause TF to appear in
    eflags as seen by PTRACE_GETREGS and the like, when the instruction faulted
    for some reason other than the single-step trap.
    
    This moves the check added by Dan's patch from setup_sigcontext to
    handle_signal.  This is a cosmetic difference, but I think it makes more
    sense to consolidate all the "reset registers to canonical state" work in
    the same place (i.e. put it with the syscall rollback code), separate from
    the signal handler setup.
    
    The change that matters is moving the similar check out of do_debug,
    where it only covers the case of a single-step trap.  Instead, it goes
    into the ptrace_signal_deliver macro, which is called before the ptrace
    stop for whatever signal results from whatever kind of fault in that
    instruction (or asynchronous signal).  With that, the handle_signal
    check is still needed only for the case of PTRACE_SINGLESTEP with a
    handled signal.
    Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    256aa113
traps.c 25.9 KB