All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#2
@ 2011-05-16 18:17 Tejun Heo
  2011-05-16 18:17 ` [PATCH 01/10] signal: remove three noop tracehooks Tejun Heo
                   ` (11 more replies)
  0 siblings, 12 replies; 88+ messages in thread
From: Tejun Heo @ 2011-05-16 18:17 UTC (permalink / raw)
  To: oleg, jan.kratochvil, vda.linux
  Cc: linux-kernel, torvalds, akpm, indan, bdonlan

Hello,

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
  JOBCTL_INTERRUPT.

* 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-signal-remove-three-noop-tracehooks.patch
  0002-job-control-introduce-JOBCTL_TRAP_STOP-and-use-it-fo.patch
  0003-ptrace-implement-PTRACE_SEIZE.patch
  0004-ptrace-implement-PTRACE_INTERRUPT.patch
  0005-ptrace-restructure-ptrace_getsiginfo.patch
  0006-ptrace-add-siginfo.si_pt_flags.patch
  0007-ptrace-make-group-stop-state-visible-via-PTRACE_GETS.patch
  0008-ptrace-don-t-let-PTRACE_SETSIGINFO-override-__SI_TRA.patch
  0009-ptrace-add-JOBCTL_BLOCK_NOTIFY.patch
  0010-ptrace-implement-group-stop-notification-for-ptracer.patch

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://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.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(-)

--
tejun

[1] http://thread.gmane.org/gmane.linux.kernel/1136930
[2] http://thread.gmane.org/gmane.linux.kernel/1139751
[3] git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc.git

^ permalink raw reply	[flat|nested] 88+ messages in thread

end of thread, other threads:[~2011-06-02  5:01 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 18:17 [PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#2 Tejun Heo
2011-05-16 18:17 ` [PATCH 01/10] signal: remove three noop tracehooks Tejun Heo
2011-05-17 16:22   ` Christoph Hellwig
2011-05-17 16:27     ` Tejun Heo
2011-05-18 18:45   ` Oleg Nesterov
2011-05-19 12:11     ` Tejun Heo
2011-05-19 16:10       ` Oleg Nesterov
2011-05-16 18:17 ` [PATCH 02/10] job control: introduce JOBCTL_TRAP_STOP and use it for group stop trap Tejun Heo
2011-05-18 16:48   ` Oleg Nesterov
2011-05-18 16:57     ` Oleg Nesterov
2011-05-19 10:19     ` Tejun Heo
2011-05-19 16:19       ` Oleg Nesterov
2011-05-16 18:17 ` [PATCH 03/10] ptrace: implement PTRACE_SEIZE Tejun Heo
2011-05-18  0:40   ` Denys Vlasenko
2011-05-18  9:55     ` Tejun Heo
2011-05-18 10:44       ` Denys Vlasenko
2011-05-18 11:14         ` Tejun Heo
2011-05-19 14:17       ` Tejun Heo
2011-05-19 15:02         ` Tejun Heo
2011-05-19 19:31         ` Pedro Alves
2011-05-19 22:42           ` Denys Vlasenko
2011-05-19 23:00             ` Pedro Alves
2011-05-20  1:44               ` Denys Vlasenko
2011-05-20  8:56                 ` Pedro Alves
2011-05-20  9:12                   ` Tejun Heo
2011-05-20  9:07               ` Tejun Heo
2011-05-20  9:27                 ` Pedro Alves
2011-05-20  9:31                   ` Tejun Heo
2011-05-24  9:49                     ` Pedro Alves
2011-05-24 12:00                       ` Tejun Heo
2011-05-24 12:36                         ` Pedro Alves
2011-05-24 14:02                           ` Tejun Heo
2011-05-24 14:55                             ` Pedro Alves
2011-05-25 18:18                             ` Oleg Nesterov
2011-05-26  9:10                               ` Tejun Heo
2011-05-26 10:01                                 ` Pedro Alves
2011-05-26 10:11                                   ` Tejun Heo
2011-05-26 14:55                                 ` Oleg Nesterov
2011-05-23 13:09         ` Oleg Nesterov
2011-05-23 12:43       ` Oleg Nesterov
2011-05-24 10:28         ` Tejun Heo
2011-05-25 18:29           ` Oleg Nesterov
2011-05-26  9:14             ` Tejun Heo
2011-05-26 15:01               ` Oleg Nesterov
2011-05-27 18:21                 ` Tejun Heo
2011-05-30 19:22                   ` Oleg Nesterov
     [not found]                     ` <BANLkTimupSd774N-VBoswOj+Dza=5ofvWQ@mail.gmail.com>
2011-05-31 19:08                       ` Oleg Nesterov
2011-05-31 21:32                         ` Linus Torvalds
2011-06-01 20:04                           ` Oleg Nesterov
2011-06-01  5:34                         ` Tejun Heo
2011-06-01 20:08                           ` Oleg Nesterov
2011-06-02  5:01                             ` Tejun Heo
2011-05-18 18:17   ` Oleg Nesterov
2011-05-19 10:34     ` Tejun Heo
2011-05-16 18:17 ` [PATCH 04/10] ptrace: implement PTRACE_INTERRUPT Tejun Heo
2011-05-18 18:38   ` Oleg Nesterov
2011-05-19 12:07     ` Tejun Heo
2011-05-19 16:21       ` Oleg Nesterov
2011-05-16 18:17 ` [PATCH 05/10] ptrace: restructure ptrace_getsiginfo() Tejun Heo
2011-05-16 18:17 ` [PATCH 06/10] ptrace: add siginfo.si_pt_flags Tejun Heo
2011-05-16 18:17 ` [PATCH 07/10] ptrace: make group stop state visible via PTRACE_GETSIGINFO Tejun Heo
2011-05-19 16:27   ` Oleg Nesterov
2011-05-19 16:40     ` Tejun Heo
2011-05-16 18:17 ` [PATCH 08/10] ptrace: don't let PTRACE_SETSIGINFO override __SI_TRAP siginfo Tejun Heo
2011-05-16 18:17 ` [PATCH 09/10] ptrace: add JOBCTL_BLOCK_NOTIFY Tejun Heo
2011-05-19 16:32   ` Oleg Nesterov
2011-05-19 16:44     ` Tejun Heo
2011-05-19 16:48       ` Oleg Nesterov
2011-05-19 16:58         ` Tejun Heo
2011-05-16 18:17 ` [PATCH 10/10] ptrace: implement group stop notification for ptracer Tejun Heo
2011-05-19 16:32   ` Oleg Nesterov
2011-05-19 16:57     ` Tejun Heo
2011-05-19 17:13       ` Oleg Nesterov
2011-05-19 22:48         ` Denys Vlasenko
2011-05-20  8:59           ` Tejun Heo
2011-05-23 13:34             ` Oleg Nesterov
2011-05-20  8:46         ` Tejun Heo
2011-05-19 16:58     ` Oleg Nesterov
2011-05-23 11:45       ` Oleg Nesterov
2011-05-24 13:44         ` Tejun Heo
2011-05-24 15:44           ` Tejun Heo
2011-05-26 14:44           ` Oleg Nesterov
2011-05-28  7:32             ` Tejun Heo
2011-05-18 18:50 ` [PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#2 Oleg Nesterov
2011-05-19 12:08   ` Tejun Heo
2011-05-19 15:04 ` Linus Torvalds
2011-05-19 15:19   ` Tejun Heo
2011-05-19 22:45   ` Denys Vlasenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.