From: Laurent Pinchart Date: Fri, 2 Aug 2013 16:55:21 +0000 (-0300) Subject: [media] media: vb2: Take queue or device lock in mmap-related vb2 ioctl handlers X-Git-Tag: v3.12-rc1~135^2~165 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a90f1a61c9b31bd0c89b8456fa4dce91ad69c57;p=pandora-kernel.git [media] media: vb2: Take queue or device lock in mmap-related vb2 ioctl handlers The vb2_fop_mmap() and vb2_fop_get_unmapped_area() functions are plug-in implementation of the mmap() and get_unmapped_area() file operations that calls vb2_mmap() and vb2_get_unmapped_area() on the queue associated with the video device. Neither the vb2_fop_mmap/vb2_fop_get_unmapped_area nor the v4l2_mmap/vb2_get_unmapped_area functions in the V4L2 core take any lock, leading to race conditions between mmap/get_unmapped_area and other buffer-related ioctls such as VIDIOC_REQBUFS. Fix it by taking the queue or device lock around the vb2_mmap() and vb2_get_unmapped_area() calls. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed