Re: + syscalls-x86-add-__nr_kcmp-syscall-v8.patch added to -mm tree

Vasiliy Kulikov
2012-02-16T18:26:00Z

On Thu, Feb 16, 2012 at 20:49 +0400, Cyrill Gorcunov wrote:
> + err = mutex_lock_killable(m1);
> + if (!err && likely(m1 != m2)) {
> + err = mutex_lock_killable_nested(m2, SINGLE_DEPTH_NESTING);

Doesn't it lead to a deadlock?

mutex_lock_killable(task1)
| mutex_lock_killable(task2)
mutex_lock_killable_nested(task2) |
(locked) |
mutex_lock_killable_nested(task1)
(locked)

I suppose you should use some global lock (kcmp_lock) before both locks.

Thanks,

--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments