linux/drivers/media
Hans Verkuil 7536e0dce3 vb2: fix vb2_thread_stop race conditions
commit 6cf11ee630 upstream.

The locking scheme inside the vb2 thread is unsafe when stopping the
thread. In particular kthread_stop was called *after* internal data
structures were cleaned up instead of doing that before. In addition,
internal vb2 functions were called after threadio->stop was set to
true and vb2_internal_streamoff was called. This is also not allowed.

All this led to a variety of race conditions and kernel warnings and/or
oopses.

Fixed by moving the kthread_stop call up before the cleanup takes
place, and by checking threadio->stop before calling internal vb2
queuing operations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2015-01-29 17:40:44 -08:00
..
common [media] saa7146: Create a device name before it's used 2014-10-21 08:51:44 -02:00
dvb-core [media] dvb-core: set default properties of ISDB-S 2014-11-03 16:40:09 -02:00
dvb-frontends [media] sp2: sp2_init() can be static 2014-11-03 19:08:06 -02:00
firewire [media] firewire: firedtv-avc: fix more potential buffer overflow 2014-09-23 16:13:39 -03:00
i2c smiapp: Take mutex during PLL update in sensor initialisation 2015-01-27 08:29:39 -08:00
mmc [media] siano: get rid of CammelCase from smscoreapi.h 2013-03-21 10:03:16 -03:00
parport [media] pms: Fix a bad usage of the stack 2014-09-26 06:47:55 -03:00
pci cx23885: Split Hauppauge WinTV Starburst from HVR4400 card entry 2015-01-29 17:40:44 -08:00
platform vivid: fix CROP_BOUNDS typo for video output 2015-01-27 08:29:40 -08:00
radio [media] wl128x: fix fmdbg compiler warning 2014-10-24 09:27:34 -02:00
rc img-ir/hw: Fix potential deadlock stopping timer 2015-01-27 08:29:40 -08:00
tuners [media] xc5000: use after free in release() 2014-10-24 09:29:28 -02:00
usb uvcvideo: Fix destruction order in uvc_delete() 2015-01-27 08:29:40 -08:00
v4l2-core vb2: fix vb2_thread_stop race conditions 2015-01-29 17:40:44 -08:00
Kconfig [media] Kconfig: do not select SPI bus on sub-driver auto-select 2014-09-04 12:18:49 -03:00
Makefile [media] move i2c files into drivers/media/i2c 2012-09-06 18:42:54 -03:00
media-device.c [media] media: Use strlcpy instead of custom code 2014-09-21 20:27:08 -03:00
media-devnode.c [media] media-devnode: just return 0 instead of using a var 2014-09-03 17:59:28 -03:00
media-entity.c [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag 2013-12-04 15:03:45 -02:00