Files
linux/drivers
Hans Verkuil e89662f06a media: vb2: vb2_mmap: move lock up
commit cd26d1c4d1 upstream.

If a filehandle is dup()ped, then it is possible to close it from one fd
and call mmap from the other. This creates a race condition in vb2_mmap
where it is using queue data that __vb2_queue_free (called from close())
is in the process of releasing.

By moving up the mutex_lock(mmap_lock) in vb2_mmap this race is avoided
since __vb2_queue_free is called with the same mutex locked. So vb2_mmap
now reads consistent buffer data.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reported-by: syzbot+be93025dd45dccd8923c@syzkaller.appspotmail.com
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-23 08:10:55 +01:00
..
2018-07-22 14:27:36 +02:00
2018-12-21 14:11:37 +01:00
2018-02-25 11:05:55 +01:00
2019-01-23 08:10:55 +01:00
2019-01-13 10:03:55 +01:00
2018-12-29 13:40:15 +01:00
2019-01-23 08:10:54 +01:00
2018-11-10 07:43:00 -08:00
2018-12-21 14:11:36 +01:00
2019-01-23 08:10:54 +01:00
2018-11-13 11:17:04 -08:00
2018-11-13 11:17:02 -08:00
2018-11-27 16:09:41 +01:00
2018-10-03 17:01:42 -07:00