lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/5] freezer,sched: Rewrite core freezer logic
On Thu, Apr 21, 2022 at 12:26:44PM -0500, Eric W. Biederman wrote:
> 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?

Why should this fail? wait_task_inactive() will in fact succeed if it is
frozen due to the added TASK_FREEZABLE and some wait_task_inactive()
changes elsewhere in this patch.

And I don't see why ptrace_freeze_traced() should fail. It'll warn
though, I should extend/remove that WARN_ON_ONCE() looking at __state,
but it should work.

\
 
 \ /
  Last update: 2022-04-21 21:57    [W:0.147 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site