| From | "Eric W. Biederman" <> | Date | Thu, 21 Apr 2022 12:26:44 -0500 | Subject | Re: [PATCH v2 5/5] freezer,sched: Rewrite core freezer logic |
| |
Peter Zijlstra <peterz@infradead.org> writes:
> --- a/kernel/ptrace.c > +++ b/kernel/ptrace.c > @@ -288,7 +288,7 @@ static int ptrace_check_attach(struct ta > } > __set_current_state(TASK_RUNNING); > > - if (!wait_task_inactive(child, TASK_TRACED) || > + if (!wait_task_inactive(child, TASK_TRACED|TASK_FREEZABLE) || > !ptrace_freeze_traced(child)) > return -ESRCH;
Do we mind that this is going to fail if the child is frozen during ptrace_check_attach?
I think to avoid that we need to safely get this to wait_task_inactive(child, 0), like the coredump code uses.
I would like to say that we can do without the wait_task_inactive, but it looks like it is necessary to ensure that all of the userspace registers are saved where the tracer can get at them.
Eric
|