Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-28 Thread Oleg Nesterov
On 04/28, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > >> The bug appears when the TRACEE makes it to schedule(). Inside > >> schedule there is a call to signal_pending_state() which notices > >> a SIGKILL is pending and refuses to sleep. > > > > And I think this is fine. This doesn't r

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-28 Thread Eric W. Biederman
Oleg Nesterov writes: > On 04/27, Eric W. Biederman wrote: >> >> "Eric W. Biederman" writes: >> >> > diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h >> > index 3c8b34876744..1947c85aa9d9 100644 >> > --- a/include/linux/sched/signal.h >> > +++ b/include/linux/sched/signal

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-28 Thread Oleg Nesterov
On 04/27, Eric W. Biederman wrote: > > "Eric W. Biederman" writes: > > > diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h > > index 3c8b34876744..1947c85aa9d9 100644 > > --- a/include/linux/sched/signal.h > > +++ b/include/linux/sched/signal.h > > @@ -437,7 +437,8 @@ extern

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Eric W. Biederman
"Eric W. Biederman" writes: > diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h > index 3c8b34876744..1947c85aa9d9 100644 > --- a/include/linux/sched/signal.h > +++ b/include/linux/sched/signal.h > @@ -437,7 +437,8 @@ extern void signal_wake_up_state(struct task_struct *t,

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Eric W. Biederman
Oleg Nesterov writes: 2> On 04/26, Eric W. Biederman wrote: >> >> static void ptrace_unfreeze_traced(struct task_struct *task) >> { >> -if (READ_ONCE(task->__state) != __TASK_TRACED) >> +if (!(READ_ONCE(task->jobctl) & JOBCTL_DELAY_WAKEKILL)) >> return; >> >> WARN_ON(!

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Eric W. Biederman
Oleg Nesterov writes: > On 04/27, Oleg Nesterov wrote: >> >> On 04/27, Eric W. Biederman wrote: >> > >> > Oleg Nesterov writes: >> > >> > > On 04/26, Eric W. Biederman wrote: >> > >> >> > >> @@ -253,7 +252,7 @@ static int ptrace_check_attach(struct task_struct >> > >> *child, bool ignore_state)

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Oleg Nesterov
On 04/27, Oleg Nesterov wrote: > > On 04/27, Eric W. Biederman wrote: > > > > Oleg Nesterov writes: > > > > > On 04/26, Eric W. Biederman wrote: > > >> > > >> @@ -253,7 +252,7 @@ static int ptrace_check_attach(struct task_struct > > >> *child, bool ignore_state) > > >> */ > > >>

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Oleg Nesterov
On 04/27, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > On 04/26, Eric W. Biederman wrote: > >> > >> @@ -253,7 +252,7 @@ static int ptrace_check_attach(struct task_struct > >> *child, bool ignore_state) > >> */ > >>if (lock_task_sighand(child, &flags)) { > >>if (chi

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Eric W. Biederman
Oleg Nesterov writes: > On 04/26, Eric W. Biederman wrote: >> >> @@ -253,7 +252,7 @@ static int ptrace_check_attach(struct task_struct >> *child, bool ignore_state) >> */ >> if (lock_task_sighand(child, &flags)) { >> if (child->ptrace && child->parent == current) { >> -

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Oleg Nesterov
On 04/26, Eric W. Biederman wrote: > > @@ -253,7 +252,7 @@ static int ptrace_check_attach(struct task_struct *child, > bool ignore_state) >*/ > if (lock_task_sighand(child, &flags)) { > if (child->ptrace && child->parent == current) { > - WARN_ON(REA

Re: [PATCH 9/9] ptrace: Don't change __state

2022-04-27 Thread Oleg Nesterov
On 04/26, Eric W. Biederman wrote: > > static void ptrace_unfreeze_traced(struct task_struct *task) > { > - if (READ_ONCE(task->__state) != __TASK_TRACED) > + if (!(READ_ONCE(task->jobctl) & JOBCTL_DELAY_WAKEKILL)) > return; > > WARN_ON(!task->ptrace || task->parent !=