Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-04 Thread Eric W. Biederman
"Eric W. Biederman" writes: > Oleg Nesterov writes: > >> On 05/03, Eric W. Biederman wrote: >>> >>> Oleg Nesterov writes: >>> >>> > But why is it bad if the tracee doesn't sleep in schedule ? If it races >>> > with SIGKILL. I still can't understand this. >>> > >>> > Yes, wait_task_inactive() ca

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-04 Thread Eric W. Biederman
Oleg Nesterov writes: > On 05/03, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > But why is it bad if the tracee doesn't sleep in schedule ? If it races >> > with SIGKILL. I still can't understand this. >> > >> > Yes, wait_task_inactive() can fail, so you need to remove WARN_ON_ONC

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-04 Thread Oleg Nesterov
On 05/03, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > But why is it bad if the tracee doesn't sleep in schedule ? If it races > > with SIGKILL. I still can't understand this. > > > > Yes, wait_task_inactive() can fail, so you need to remove WARN_ON_ONCE() > > in 11/12. > > > > > Why i

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-03 Thread Eric W. Biederman
Oleg Nesterov writes: > On 05/02, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> >> #define TASK_KILLABLE(TASK_WAKEKILL | >> >> TASK_UNINTERRUPTIBLE) >> >> #define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED) >> >> -#define TASK_TRACED

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-03 Thread Oleg Nesterov
On 05/02, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > >> #define TASK_KILLABLE (TASK_WAKEKILL | > >> TASK_UNINTERRUPTIBLE) > >> #define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED) > >> -#define TASK_TRACED (TASK_WAKEKIL

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-02 Thread Eric W. Biederman
Oleg Nesterov writes: > On 04/29, Eric W. Biederman wrote: >> >> Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace >> command is executing. > > Eric, I'll read this patch and the rest of this series tomorrow. > Somehow I failed to force myself to read yet another version after

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-02 Thread Oleg Nesterov
On 04/29, Eric W. Biederman wrote: > > static void ptrace_unfreeze_traced(struct task_struct *task) > { > - if (READ_ONCE(task->__state) != __TASK_TRACED) > - return; > - > - WARN_ON(!task->ptrace || task->parent != current); > + unsigned long flags; > > /* > -

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-02 Thread Oleg Nesterov
On 04/29, Eric W. Biederman wrote: > > Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace > command is executing. Eric, I'll read this patch and the rest of this series tomorrow. Somehow I failed to force myself to read yet another version after weekend ;) plus I don't really u

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-05-02 Thread Sebastian Andrzej Siewior
On 2022-04-29 16:48:32 [-0500], Eric W. Biederman wrote: > Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace > command is executing. > > Instead TASK_WAKEKILL from the definition of TASK_TRACED, and > implemention a new jobctl flag TASK_PTRACE_FROZEN. This new This new Instea

Re: [PATCH v2 07/12] ptrace: Don't change __state

2022-04-29 Thread Peter Zijlstra
On Fri, Apr 29, 2022 at 04:48:32PM -0500, Eric W. Biederman wrote: > Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace > command is executing. > > Instead TASK_WAKEKILL from the definition of TASK_TRACED, and > implemention a new jobctl flag TASK_PTRACE_FROZEN. This new This n

[PATCH v2 07/12] ptrace: Don't change __state

2022-04-29 Thread Eric W. Biederman
Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace command is executing. Instead TASK_WAKEKILL from the definition of TASK_TRACED, and implemention a new jobctl flag TASK_PTRACE_FROZEN. This new This new flag is set in jobctl_freeze_task and cleared when ptrace_stop is awoken o