linux/drivers/media
Maxim Levitsky 9900132f34 V4L/DVB (6268): V4L: Fix a lock inversion in generic videobuf code
videobuf_qbuf takes q->lock, and then calls
q->ops->buf_prepare which by design in all drivers calls
videobuf_iolock which calls videobuf_dma_init_user and this
takes current->mm->mmap_sem

on the other hand if user calls mumap from other thread, sys_munmap
takes current->mm->mmap_sem and videobuf_vm_close takes q->lock

Since this can occur only for V4L2_MEMORY_MMAP buffers, take
current->mm->mmap_sem in qbuf, before q->lock, and don't take
current->mm->mmap_sem videobuf_dma_init_user for those buffers

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:58 -03:00
..
common V4L/DVB (6252): Adapt drivers to use the newer videobuf modules 2007-10-09 22:14:55 -03:00
dvb V4L/DVB (6241): fix typo in DVB_PLL Kconfig help text 2007-10-09 22:14:50 -03:00
radio V4L/DVB (6246): GemTek Radio card - Control Word 2007-10-09 22:14:51 -03:00
video V4L/DVB (6268): V4L: Fix a lock inversion in generic videobuf code 2007-10-10 00:02:58 -03:00
Kconfig V4L/DVB (6260): Fix Kconfig dependency 2007-10-10 00:02:49 -03:00
Makefile V4L/DVB (5599): Use menuconfig objects II - DVB 2007-05-09 10:12:48 -03:00