Messages in this thread | | | Date | Mon, 18 Apr 2022 19:19:42 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 2/5] sched,ptrace: Fix ptrace_check_attach() vs PREEMPT_RT |
| |
On 04/18, Oleg Nesterov wrote: > > static int ptrace_check_attach(struct task_struct *child, bool ignore_state) > { ... > + if (!traced) > + return -ESRCH; > + > + WARN_ON(READ_ONCE(child->__state) == __TASK_TRACED); > + if (ignore_state) > + return 0; > + > + if (!task_is_traced(child)) > + return -ESRCH;
This is the new check V1 didn't have, we need it to unsure that check_attach can't miss the change in child->jobctl and call wait_task_inactive() before the child marks itself as "traced" and clears JOBCTL_TRACED_XXX.
Oleg.
| |