Skip to content

Draft: ptrace: Upstream sync-up for RT issues

Due to RT sleeping locks, a task's ->__state can be clobbered and lose TASK_TRACED / TASK_STOPPED, which in turn can cause missed wakeups.

Upstream solved this by moving the special states TASK_TRACED and TASK_STOPPED in task_struct.jobctl, which is backported here.

The patches are ordered as follows (using upstream SHA1, older patches first):

Prerequisite patches: 336d4b814bf07 ptrace: Move setting/clearing ptrace_message into ptrace_stop 6487d1dab8372 ptrace: Return the signal to continue with from ptrace_stop

Original upstream series: 157cc18122b4a signal: Rename send_signal send_signal_locked e71ba124078e3 signal: Replace __group_send_sig_info with send_signal_locked c200e4bb44e80 ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP 4a3d2717d1404 ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP 16cc1bc67de88 ptrace: Remove arch_ptrace_attach cb3c19c93d656 signal: Use lockdep_assert_held instead of assert_spin_locked 6a2d90ba027ad ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 7b0fe1367ef2d ptrace: Document that wait_task_inactive can't fail 57b6de08b5f65 ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs 2500ad1c7fa42 ptrace: Don't change __state 5b4197cb287da ptrace: Always take siglock in ptrace_resume 31cae1eaae4fd sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state

Later fixes: de2a34771f512 ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced() a382f8fee42ca signal handling: don't use BUG_ON() for debugging

Outstanding linux-rt patches: 958311fde6e7b signal: Add proper comment about the preempt-disable in ptrace_stop(). 72a0db0de145d signal: Don't disable preemption in ptrace_stop() on PREEMPT_RT.

Signed-off-by: Valentin Schneider vschneid@redhat.com

Merge request reports