[lkml]   [2011]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subject[PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#2

    This is the second try at implementing PTRACE_SEIZE/INTERRUPT and
    group stop notification. Notable changes from the first take[1] are,

    * Prep patches moved to a separate patchset[2].

    * JOBCTL_EVENT_INTERRUPT renamed to JOBCTL_EVENT_STOP and now also
    used for group stop. This means that PTRACE_GETSIGINFO will always
    return a valid siginfo. For signal delivery traps, it will contain
    the siginfo for the signal being delivered. For all other traps, it
    will contain the trap information which includes group stop info.

    * JOBCTL_TRAP_STOP trap doesn't carry signo in si_code and the signal
    which initiated the group stop currently in effect can be obtained
    from siginfo.si_signo.

    * JOBCTL_INTERRUPT triggers JOBCTL_EVENT_STOP and gets cleared on any
    trap, so the initial trap by JOBCTL_SEIZE is identical to

    * PTRACE_SETSIGINFO disallows overriding __SI_TRAP siginfo.

    * Re-trap delay mechanism added to avoid re-trapping while ptrace
    request is in progress.

    So, PTRACE_INTERRUPT simply puts the tracee into the same state as
    group stop and this simplifies things a lot. Trap siginfo is also
    accessible during group stop and group stop notification happening
    during PTRACE_EVENT_STOP makes sense and there's no awkward careful
    sequencing of traps to avoid unnecessary traps. I think it makes
    whole lot more sense this way.

    This patchset contains the following ten patches.


    0001 removes three signal tracehooks. Will be moved to the prep
    patchset on the next round.

    0002 introduces TRAP_STOP and 0003-0004 implement SEIZE and INTERRUPT.

    0005-0008 expose group stop info via GETSIGINFO.

    0009-0010 implement group stop notification.

    This patchset is on top of Oleg's ptrace branch[3] + prep patchset[2]
    and available in the following git branch.

    git:// review-ptrace-seize

    The HEAD is 8026ce454dd46dc3c8cf6bbc57bcd30f5efa4e55. If you see
    older branch, please retry after a while (korg is still syncing).

    diffstat follows.

    arch/ia64/include/asm/siginfo.h | 7 +
    arch/ia64/kernel/signal.c | 5
    arch/mips/include/asm/compat-signal.h | 7 +
    arch/mips/include/asm/siginfo.h | 7 +
    arch/mips/kernel/signal32.c | 5
    arch/parisc/kernel/signal32.c | 5
    arch/parisc/kernel/signal32.h | 7 +
    arch/powerpc/kernel/ppc32.h | 7 +
    arch/powerpc/kernel/signal_32.c | 5
    arch/s390/kernel/compat_linux.h | 7 +
    arch/s390/kernel/compat_signal.c | 5
    arch/sparc/kernel/signal32.c | 12 +
    arch/tile/kernel/compat_signal.c | 11 +
    arch/x86/ia32/ia32_signal.c | 4
    arch/x86/include/asm/ia32.h | 7 +
    include/asm-generic/siginfo.h | 10 +
    include/linux/ptrace.h | 13 ++
    include/linux/sched.h | 6
    include/linux/tracehook.h | 52 --------
    kernel/ptrace.c | 202 +++++++++++++++++++++++++++----
    kernel/signal.c | 215 +++++++++++++++++++++++-----------
    21 files changed, 452 insertions(+), 147 deletions(-)


    [3] git://

     \ /
      Last update: 2011-05-16 20:19    [W:0.023 / U:3.800 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site