From: Stefan Richter Date: Sun, 26 Oct 2008 11:02:03 +0000 (+0100) Subject: ieee1394: dv1394: fix possible deadlock in multithreaded clients X-Git-Tag: v2.6.28-rc4~25^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8449fc3ae58bf8ee5acbd2280754cde67b5db128;p=pandora-kernel.git ieee1394: dv1394: fix possible deadlock in multithreaded clients Fix a possible though highly unlikely deadlock: Thread A: Thread B: - acquire mmap_sem - dv1394_ioctl/read/write() - dv1394_mmap() - acquire video->mtx - acquire video->mtx - copy_to/from_user(), possible page fault: acquire mmap_sem The simplest fix is to use mutex_trylock() instead of mutex_lock() in dv1394_mmap(). This changes the behavior under contention in a way which is visible to userspace clients. However, my guess is that no clients exist which use mmap vs. ioctl/read/write on the dv1394 character device file interface in concurrent threads. Reported-by: Johannes Weiner Signed-off-by: Stefan Richter --- Reading git-diff-tree failed