Re: [PATCH] ptrace: fix ptrace_unfreeze_traced() race with rt-lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-11-02 18:01:33 [+0100], Oleg Nesterov wrote:

> So it seems I should send V2 which uses raw_spin_(un)lock_irq().
> 
> Or even _irqsave() like ptrace_freeze_traced() does? Although this looks
> confusing, exactly because ptrace_freeze_traced() calls task_is_traced()
> which does raw_spin_lock_irq().

Urgh. Judging from
 release_task()
 -> write_lock_irq(&tasklist_lock);
 -> ptrace_release_task();
    -> ptrace_unlink();
       -> __ptrace_unlink();
         -> task_is_traced().

it will break on !RT so irqsave is indeed needed. And yes, using
task_is_traced() and then acquired the PI lock again looks like too
much.

Either complain or send a patch, I will look tomorrow.

> Oleg.

Sebastian



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux