Messages in this thread | | | Date | Thu, 28 Apr 2022 12:42:07 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach |
| |
On Wed, Apr 27, 2022 at 05:14:57PM +0200, Oleg Nesterov wrote: > On 04/26, Eric W. Biederman wrote: > > > > Asking wait_task_inactive to verify that tsk->__state == __TASK_TRACED > > was needed to detect the when ptrace_stop would decide not to stop > > after calling "set_special_state(TASK_TRACED)". With the recent > > cleanups ptrace_stop will always stop after calling set_special_state. > > > > Take advatnage of this by no longer asking wait_task_inactive to > > verify the state. If a bug is hit and wait_task_inactive does not > > succeed warn and return -ESRCH. > > ACK, but I think that the changelog is wrong. > > We could do this right after may_ptrace_stop() has gone. This doesn't > depend on the previous changes in this series.
It very much does rely on there not being any blocking between set_special_state() and schedule() tho. So all those PREEMPT_RT spinlock->rt_mutex things need to be gone.
That is also the reason I couldn't do wait_task_inactive(task, 0) in the other patch, I had to really match 'TASK_TRACED or TASK_FROZEN' any other state must fail (specifically TASK_RTLOCK_WAIT must not match).
| |