linux-kernel-test/drivers/ieee1394
Stefan Richter 8449fc3ae5 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 <hannes@saeurebad.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-10-31 08:48:26 +01:00
..
config_roms.c
config_roms.h
csr1212.c ieee1394: Use DIV_ROUND_UP 2008-10-15 22:21:07 +02:00
csr1212.h ieee1394: csr1212: proper refcounting 2007-10-16 23:59:59 +02:00
csr.c ieee1394: be*_add_cpu conversion 2008-04-18 17:55:29 +02:00
csr.h
dma.c ieee1394: dump mmapped iso buffers in core files 2008-07-14 13:06:02 +02:00
dma.h
dv1394-private.h
dv1394.c ieee1394: dv1394: fix possible deadlock in multithreaded clients 2008-10-31 08:48:26 +01:00
dv1394.h
eth1394.c ieee1394: Use DIV_ROUND_UP 2008-10-15 22:21:07 +02:00
eth1394.h
highlevel.c ieee1394: video1394: reorder module init, prepare BKL removal 2008-07-14 13:06:02 +02:00
highlevel.h ieee1394: video1394: reorder module init, prepare BKL removal 2008-07-14 13:06:02 +02:00
hosts.c ieee1394: struct device - replace bus_id with dev_name(), dev_set_name() 2008-10-31 08:48:25 +01:00
hosts.h
ieee1394_core.c ieee1394: limit early node speed to host interface speed 2008-04-18 17:55:31 +02:00
ieee1394_core.h
ieee1394_hotplug.h
ieee1394_transactions.c ieee1394: remove unused code 2008-01-30 22:22:20 +01:00
ieee1394_transactions.h
ieee1394_types.h
ieee1394-ioctl.h
ieee1394.h
init_ohci1394_dma.c x86: early boot debugging via FireWire (ohci1394_dma=early) 2008-01-30 13:34:11 +01:00
iso.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
iso.h ieee1394: rawiso: requeue packet for transmission after skipped cycle 2008-04-25 18:15:45 +02:00
Kconfig ieee1394: Kconfig menu touch-up 2008-06-19 00:12:36 +02:00
Makefile x86: early boot debugging via FireWire (ohci1394_dma=early) 2008-01-30 13:34:11 +01:00
nodemgr.c ieee1394: struct device - replace bus_id with dev_name(), dev_set_name() 2008-10-31 08:48:25 +01:00
nodemgr.h ieee1394: survive a few seconds connection loss 2008-10-15 22:21:09 +02:00
ohci1394.c ieee1394: rawiso: requeue packet for transmission after skipped cycle 2008-04-25 18:15:45 +02:00
ohci1394.h
pcilynx.c ieee1394: Use shorter list_splice_init() for brevity. 2008-04-18 17:55:30 +02:00
pcilynx.h
raw1394-private.h ieee1394: raw1394: replace BKL by local mutex, make ioctl() and mmap() thread-safe 2008-10-15 22:21:08 +02:00
raw1394.c ieee1394: raw1394: fix possible deadlock in multithreaded clients 2008-10-31 08:48:26 +01:00
raw1394.h
sbp2.c ieee1394: sbp2: enforce s/g segment size limit 2008-10-15 22:21:07 +02:00
sbp2.h ieee1394: sbp2: enforce s/g segment size limit 2008-10-15 22:21:07 +02:00
video1394.c ieee1394: dv1394, video1394: remove unnecessary expressions 2008-10-15 22:21:09 +02:00
video1394.h