Re: [PATCH 2/5] sched,ptrace: Fix ptrace_check_attach() vs PREEMPT_RT

From: Peter Zijlstra
Date: Wed Apr 13 2022 - 15:21:28 EST


On Wed, Apr 13, 2022 at 08:59:10PM +0200, Oleg Nesterov wrote:


> + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> + // wrong, needs siglock
> + current->jobctl &= ~JOBCTL_TRACED_XXX;
> + wake_up_bit(&current->jobctl, ~JOBCTL_TRACED_XXX_BIT);
__wake_up_common_lock()
spin_lock_irqsave()
current_save_and_set_rtlock_wait_state();

> + if (wait_on_bit(&task->jobctl, JOBCTL_TRACED_XXX_BIT, TASK_KILLABLE))
> + return -EINTR;
> + // now that the tracee cleared JOBCTL_TRACED_XXX_BIT
> + // wait_task_inactive() should succeed or fail "really soon".
> + if (!wait_task_inactive(child, __TASK_TRACED))
> + return ret;


*whoopsie* ?

> preempt_enable_no_resched();
> freezable_schedule();
> cgroup_leave_frozen(true);