lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

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