linux_dsm_epyc7002/drivers/media
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
..
common [media] tpg: Export the tpg code from vivid as a module 2016-04-20 16:14:39 -03:00
dvb-core [media] drivers/media/dvb-core/en50221: move code to dvb_ca_private_free() 2016-06-07 17:14:43 -03:00
dvb-frontends [media] m88rs2000: initialize status to zero 2016-06-10 08:41:36 -03:00
firewire [media] dvb: modify core to implement interfaces/entities at MC new gen 2016-01-11 12:18:52 -02:00
i2c remove lots of IS_ERR_VALUE abuses 2016-05-27 15:26:11 -07:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci [media] Change frontend allocation strategy for NetUP Universal DVB cards 2016-06-07 12:16:37 -03:00
platform [media] s5p-mfc: fix a typo in s5p_mfc_dec 2016-06-07 13:03:52 -03:00
radio [media] tea575x: convert to library 2016-02-10 09:34:28 -02:00
rc [media] drivers/media/rc: postpone kfree(rc_dev) 2016-05-07 11:21:04 -03:00
tuners [media] mt2063: use lib gcd 2016-06-09 15:58:32 -03:00
usb [media] media-device: dynamically allocate struct media_devnode 2016-06-15 17:57:24 -03:00
v4l2-core Update my main e-mails at the Kernel tree 2016-06-14 14:55:18 -03:00
Kconfig [media] Kconfig: Re-enable Media controller support for DVB 2016-01-11 12:18:40 -02:00
Makefile
media-device.c [media] media-device: dynamically allocate struct media_devnode 2016-06-15 17:57:24 -03:00
media-devnode.c [media] media-device: dynamically allocate struct media_devnode 2016-06-15 17:57:24 -03:00
media-entity.c [media] media: change pipeline validation return error 2016-04-29 08:07:17 -03:00