Messages in this thread | | | Date | Wed, 15 Aug 2012 15:01:59 +0200 | From | Oleg Nesterov <> | Subject | Re: yama_ptrace_access_check(): possible recursive locking detected |
| |
On 08/14, Kees Cook wrote: > > Okay, I've now managed to reproduce this locally. I added a bunch of > debugging, and I think I understand what's going on. This warning is, > actually, a false positive.
Sure. I mean that yes, this warning doesn't mean we already hit deadlock.
> get used recursively (the task_struct->alloc_lock), but they are > separate instantiations ("task" is never "current").
Yes. But suppose that we have 2 tasks T1 and T2,
- T1 does ptrace(PTRACE_ATTACH, T2);
- T2 does ptrace(PTRACE_ATTACH, T1);
at the same time. This can lead to the "real" deadlock, no?
> So Oleg's suggestion of removing the locking around the reading of > ->comm is wrong since it really does need the lock.
Nothing bad can happen without the lock. Yes, printk() can print some string "in between" if we race with set_task_comm() but this is all.
BTW, set_task_comm()->wmb() and memset() should die. There are not needed afaics, and the comment is misleading.
Oleg.
| |