kernel_optimize_test/drivers/media
Sakari Ailus ad608fbcf1 media: v4l: event: Prevent freeing event subscriptions while accessed
The event subscriptions are added to the subscribed event list while
holding a spinlock, but that lock is subsequently released while still
accessing the subscription object. This makes it possible to unsubscribe
the event --- and freeing the subscription object's memory --- while
the subscription object is simultaneously accessed.

Prevent this by adding a mutex to serialise the event subscription and
unsubscription. This also gives a guarantee to the callback ops that the
add op has returned before the del op is called.

This change also results in making the elems field less special:
subscriptions are only added to the event list once they are fully
initialised.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org # for 4.14 and up
Fixes: c3b5b0241f ("V4L/DVB: V4L: Events: Add backend")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-03 06:32:51 -04:00
..
cec - New Drivers 2018-08-20 15:38:44 -07:00
common media updates for v4.19-rc1 2018-08-15 18:29:14 -07:00
dvb-core
dvb-frontends Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-08-21 17:40:46 -07:00
firewire
i2c media: i2c: mt9v111: Fix v4l2-ctrl error handling 2018-09-12 06:44:01 -04:00
mmc
pci
platform media: platform: fix cros-ec-cec build error 2018-09-17 14:32:29 -04:00
radio
rc
spi
tuners Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-08-21 17:40:46 -07:00
usb media: af9035: prevent buffer overflow on write 2018-08-29 13:54:37 -04:00
v4l2-core media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 06:32:51 -04:00
Kconfig
Makefile
media-device.c Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax 2018-08-26 11:48:42 -07:00
media-devnode.c
media-entity.c