linux/drivers/media/usb
Mauro Carvalho Chehab a087ce704b [media] media-device: dynamically allocate struct media_devnode
struct media_devnode is currently embedded at struct media_device.

While this works fine during normal usage, it leads to a race
condition during devnode unregister. the problem is that drivers
assume that, after calling media_device_unregister(), the struct
that contains media_device can be freed. This is not true, as it
can't be freed until userspace closes all opened /dev/media devnodes.

In other words, if the media devnode is still open, and media_device
gets freed, any call to an ioctl will make the core to try to access
struct media_device, with will cause an use-after-free and even GPF.

Fix this by dynamically allocating the struct media_devnode and only
freeing it when it is safe.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-15 17:57:24 -03:00
..
airspy [media] airspy: fix bit set/clean mess on s->flags 2016-03-01 10:48:17 -03:00
as102 [media] drivers/media/usb/as102: constify as102_priv_ops_t structure 2016-02-01 07:31:48 -02:00
au0828 [media] media-device: dynamically allocate struct media_devnode 2016-06-15 17:57:24 -03:00
b2c2 [media] media: change email address 2016-01-25 12:01:08 -02:00
cpia2 [media] usb/cpia2_core: clean up a min_t() cast 2016-02-19 08:10:32 -02:00
cx231xx Merge branch 'i2c/for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-05-19 17:48:12 -07:00
dvb-usb scripts/spelling.txt: add "fimware" misspelling 2016-05-19 19:12:14 -07:00
dvb-usb-v2 [media] af9035: fix logging 2016-06-09 08:47:48 -03:00
em28xx [media] em28xx-i2c: rt_mutex_trylock() returns zero on failure 2016-06-10 08:29:40 -03:00
go7007 [media] v4l2-device.h: add v4l2_device_mask_ variants 2016-04-20 16:08:42 -03:00
gspca [media] touptek: cast char types on %x printk 2016-03-10 13:37:45 -03:00
hackrf Merge branch 'patchwork' into v4l_for_linus 2016-01-11 11:13:27 -02:00
hdpvr [media] hdpvr: hide unused variable 2016-02-01 13:14:27 -02:00
msi2500 [media] msi2500: Delete an unnecessary check in msi2500_set_usb_adc() 2016-01-25 15:15:39 -02:00
pvrusb2 [media] pvrusb2: fix smatch errors 2016-04-20 15:48:29 -03:00
pwc [media] pwc: Add USB id for Philips Spc880nc webcam 2016-02-01 10:21:10 -02:00
s2255 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
siano [media] media_device: move allocation out of media_device_*_init 2016-02-23 07:19:39 -03:00
stk1160 [media] stk1160: Remove redundant vb2_buf payload set 2016-02-01 07:37:20 -02:00
stkwebcam
tm6000 [media] include/media: split I2C headers from V4L2 core 2015-11-17 06:57:11 -02:00
ttusb-budget [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
ttusb-dec [media] ttusb-dec: constify ttusbdecfe_config structure 2015-11-19 11:22:15 -02:00
usbtv [media] usbtv: correctly handling failed allocation 2016-02-01 07:42:00 -02:00
usbvision [media] usbvision: revert commit 588afcc1 2016-04-20 15:58:54 -03:00
uvc [media] media-device: dynamically allocate struct media_devnode 2016-06-15 17:57:24 -03:00
zr364xx [media] usb drivers: use BUG_ON() instead of if () BUG 2015-06-09 18:30:09 -03:00
Kconfig
Makefile