Messages in this thread | | | Date | Thu, 11 Mar 2021 16:21:23 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH] ptrace: Allow other threads to access tracee |
| |
On 03/10, Jim Newsome wrote: > > @@ -238,7 +238,7 @@ static int ptrace_check_attach(struct task_struct *child, bool ignore_state) > * be changed by us so it's not changing right after this. > */ > read_lock(&tasklist_lock); > - if (child->ptrace && child->parent == current) { > + if (child->ptrace && same_thread_group(child->parent, current)) {
Cough... it is not that simple.
Just suppose that 2 threads call ptrace(tracee) at the same time. Say, the 1st thread does PTRACE_CONT while the 2nd thread tries to change the registers.
Oleg.
| |