Skip to content

ptrace: cleaning up ptrace_stop

Eric W. Biederman linux-alpha linux-ia64 linux-pm linux-um lkml stable 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest12 patches 35 repliesIn review
  2. v311 patches 10 repliesSuperseded
  3. v212 patches 16 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v19 patches41 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12signal: Rename send_signal send_signal_lockedinclude/linux/signal.h kernel/signal.c+14 -120 replies
2/12signal: Replace __group_send_sig_info with send_signal_lockeddrivers/tty/tty_jobctrl.c include/linux/signal.h kernel/signal.c +1 more+6 -130 replies
3/12ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEParch/um/include/asm/thread_info.h arch/um/kernel/exec.c arch/um/kernel/process.c +3 more+10 -90 replies
4/12ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEParch/xtensa/kernel/ptrace.c arch/xtensa/kernel/signal.c include/linux/ptrace.h+4 -100 replies
5/12ptrace: Remove arch_ptrace_attacharch/ia64/include/asm/ptrace.h arch/ia64/kernel/ptrace.c kernel/ptrace.c+0 -790 replies
6/12signal: Use lockdep_assert_held instead of assert_spin_lockedkernel/signal.c+2 -20 replies
7/12ptrace: Reimplement PTRACE_KILL by always sending SIGKILLarch/x86/kernel/step.c kernel/ptrace.c+3 -50 replies
8/12ptrace: Document that wait_task_inactive can't failkernel/ptrace.c+3 -111 reply
9/12ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPskernel/signal.c+38 -540 replies
10/12ptrace: Don't change __stateinclude/linux/sched.h include/linux/sched/jobctl.h include/linux/sched/signal.h +3 more+21 -285 replies
11/12ptrace: Always take siglock in ptrace_resumekernel/ptrace.c+2 -110 replies
12/12sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED stateinclude/linux/sched.h include/linux/sched/jobctl.h include/linux/sched/signal.h +2 more+45 -1420 replies

Reviews trailers per patch

2 of 12 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohannes BergMax FilippovKees CookOleg Nesterov
SeriesT-b R-b
1/12
2/12
3/12A-b
4/12A-b
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/12] ptrace: cleaning up ptrace_stop

The states TASK_STOPPED and TASK_TRACE are special in they can not handle spurious wake-ups. This plus actively depending upon and changing the value of tsk->__state causes problems for PREEMPT_RT and Peter's freezer rewrite.

There are a lot of details we have to get right to sort out the technical challenges and this is my parred back version of the changes that contains just those problems I see good solutions to that I believe are ready.

A couple of issues have been pointed but I think this parred back set of changes is still on the right track. The biggest change in v4 is the split of "ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs" into two patches because the dependency I thought exited between two different changes did not exist. The rest of the changes are minor tweaks to "ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs"; removing an always true branch, and adding an early test to see if the ptracer had gone, before TASK_TRAPPING was set.

This set of changes should support Peter's freezer rewrite, and with the addition of changing wait_task_inactive(TASK_TRACED) to be wait_task_inactive(0) in ptrace_check_attach I don't think there are any races or issues to be concerned about from the ptrace side.

More work is needed to support PREEMPT_RT, but these changes get things closer.

This set of changes continues to look like it will provide a firm foundation for solving the PREEMPT_RT and freezer challenges.

Eric W. Biederman (11):
signal: Rename send_signal send_signal_locked
signal: Replace __group_send_sig_info with send_signal_locked ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP
ptrace: Remove arch_ptrace_attach
signal: Use lockdep_assert_held instead of assert_spin_locked
ptrace: Reimplement PTRACE_KILL by always sending SIGKILL
ptrace: Document that wait_task_inactive can't fail
ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs
ptrace: Don't change __state
ptrace: Always take siglock in ptrace_resume

Peter Zijlstra (1):
sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state

 arch/ia64/include/asm/ptrace.h    |   4 --
 arch/ia64/kernel/ptrace.c         |  57 ----------------
 arch/um/include/asm/thread_info.h |   2 +
 arch/um/kernel/exec.c             |   2 +-
 arch/um/kernel/process.c          |   2 +-
 arch/um/kernel/ptrace.c           |   8 +--
 arch/um/kernel/signal.c           |   4 +-
 arch/x86/kernel/step.c            |   3 +-
 arch/xtensa/kernel/ptrace.c       |   4 +-
 arch/xtensa/kernel/signal.c       |   4 +-
 drivers/tty/tty_jobctrl.c         |   4 +-
 include/linux/ptrace.h            |   7 --
 include/linux/sched.h             |  10 ++-
 include/linux/sched/jobctl.h      |   8 +++
 include/linux/sched/signal.h      |  20 ++++--
 include/linux/signal.h            |   3 +-
 kernel/ptrace.c                   |  87 ++++++++---------------
 kernel/sched/core.c               |   5 +-
 kernel/signal.c                   | 140 +++++++++++++++++---------------------
 kernel/time/posix-cpu-timers.c    |   6 +-
 20 files changed, 140 insertions(+), 240 deletions(-)

Eric