Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-28 Thread Oleg Nesterov
On 04/28, Peter Zijlstra wrote: > > On Thu, Apr 28, 2022 at 04:57:50PM +0200, Oleg Nesterov wrote: > > > > Shouldn't we then switch wait_task_inactive() so have & matching instead > > > of the current ==. > > > > Sorry, I don't understand the context... > > This.. I've always found it strange to ha

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-28 Thread Peter Zijlstra
On Thu, Apr 28, 2022 at 04:57:50PM +0200, Oleg Nesterov wrote: > > Shouldn't we then switch wait_task_inactive() so have & matching instead > > of the current ==. > > Sorry, I don't understand the context... This.. I've always found it strange to have wti use a different matching scheme from ttw

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-28 Thread Oleg Nesterov
On 04/28, Peter Zijlstra wrote: > > On Thu, Apr 28, 2022 at 01:19:11PM +0200, Oleg Nesterov wrote: > > > That is also the reason I couldn't do wait_task_inactive(task, 0) > > > > Ah, I din't notice this patch uses wait_task_inactive(child, 0), > > I think it should do wait_task_inactive(child, __TA

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-28 Thread Peter Zijlstra
On Thu, Apr 28, 2022 at 01:19:11PM +0200, Oleg Nesterov wrote: > > That is also the reason I couldn't do wait_task_inactive(task, 0) > > Ah, I din't notice this patch uses wait_task_inactive(child, 0), > I think it should do wait_task_inactive(child, __TASK_TRACED). Shouldn't we then switch wait_

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-28 Thread Oleg Nesterov
On 04/28, Peter Zijlstra wrote: > > 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 > > >

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-28 Thread Peter Zijlstra
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)

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-27 Thread Oleg Nesterov
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

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-27 Thread Eric W. Biederman
"Eric W. Biederman" writes: > "Eric W. Biederman" writes: > >> 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

Re: [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-27 Thread Eric W. Biederman
"Eric W. Biederman" writes: > 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_sp

[PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-26 Thread Eric W. Biederman
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 b