lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] ptrace: fix ptrace vs tasklist_lock race on PREEMPT_RT.
On Fri, Apr 08, 2022 at 10:06:30PM +0200, Peter Zijlstra wrote:

> I'll ponder if wait_task_inactive() can simplify things..

This,.. so ptrace_check_attach(), which does ptrace_freeze_traced()
already does wait_task_inactive(), but on the 'wrong' side of things.

AFAICT, if we move that up, we're almost there, except that opens up a
detach+attach race. That could be fixed by doing another
wait_task_inactive(), but we can't due to locking :/

Let's see if I can make that work without making a mess of things.
Because ensuring the task is stuck in schedule() makes the whole
saved_state thing go away -- as you noted.

\
 
 \ /
  Last update: 2022-04-11 13:36    [W:1.551 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site