alistair23-linux/include/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
..
davinci
drv-intf media: include: media: Add Renesas CEU driver interface 2018-02-26 08:59:41 -05:00
i2c media: i2c: lm3560: add support for lm3559 chip 2018-06-28 07:10:01 -04:00
tpg media: include/(uapi/)media: add SPDX license info 2018-02-14 13:23:51 -05:00
cec-notifier.h media: cec-notifier: Get notifier by device and connector name 2018-07-13 08:44:16 +01:00
cec-pin.h media: cec: add support for 5V signal testing 2018-07-25 07:11:48 -04:00
cec.h media: cec: add support for 5V signal testing 2018-07-25 07:11:48 -04:00
demux.h media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dmxdev.h media: dmxdev: Fix the logic that enables DMA mmap support 2018-02-23 05:27:10 -05:00
dvb-usb-ids.h media: dvb: add alternative USB PID for Hauppauge WinTV-soloHD 2018-05-04 14:20:55 -04:00
dvb_ca_en50221.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_demux.h media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dvb_frontend.h media: dvb: represent min/max/step/tolerance freqs in Hz 2018-08-02 18:10:48 -04:00
dvb_math.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_net.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_ringbuffer.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_vb2.h media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dvbdev.h media: dvbdev: add a mutex protecting the "mdev" pointer 2018-05-11 12:09:59 -04:00
imx.h
media-device.h
media-devnode.h
media-entity.h media: entity: fix spelling for media_entity_get_fwnode_pad() 2018-05-09 15:49:41 -04:00
rc-core.h media: rc: default to idle on at startup or after reset 2018-05-14 07:14:51 -04:00
rc-map.h media: rc: add new imon protocol decoder and encoder 2018-03-21 11:12:29 -04:00
rcar-fcp.h
soc_camera.h
tuner-types.h
tuner.h
tveeprom.h
v4l2-async.h media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
v4l2-clk.h
v4l2-common.h media: v4l-common: Make v4l2_find_nearest_size more sparse-friendly 2018-06-28 09:23:56 -04:00
v4l2-ctrls.h media: v4l2-ctrls.h: fix v4l2_ctrl field description typos 2018-07-25 08:36:05 -04:00
v4l2-dev.h media: v4l2-core: push taking ioctl mutex down to ioctl handler 2018-05-28 16:31:44 -04:00
v4l2-device.h media: v4l2-device.h: always expose mdev 2018-05-11 11:26:56 -04:00
v4l2-dv-timings.h media: v4l2-dv-timings: add v4l2_hdmi_colorimetry() 2018-02-22 12:41:09 -05:00
v4l2-event.h media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
v4l2-fh.h media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 06:32:51 -04:00
v4l2-flash-led-class.h
v4l2-fwnode.h media: v4l: fwnode: Fix comment incorrectly mentioning v4l2_fwnode_parse_endpoint 2018-04-23 17:20:07 -04:00
v4l2-image-sizes.h
v4l2-ioctl.h media: v4l2-ioctl: create helper to fill in v4l2_standard for ENUMSTD 2018-06-28 07:29:24 -04:00
v4l2-mc.h
v4l2-mediabus.h media: v4l2-fwnode: parse 'data-enable-active' prop 2018-07-24 14:57:38 -04:00
v4l2-mem2mem.h media: v4l2-mem2mem: add v4l2_m2m_last_buf() 2018-07-25 08:10:31 -04:00
v4l2-rect.h media: include/(uapi/)media: add SPDX license info 2018-02-14 13:23:51 -05:00
v4l2-subdev.h media: add tuner standby op, use where needed 2018-03-21 12:05:39 -04:00
videobuf-core.h MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
videobuf-dma-contig.h
videobuf-dma-sg.h MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
videobuf-vmalloc.h MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
videobuf2-core.h media: vb2-core: vb2_ops: document non-interrupt-context calling 2018-03-21 12:01:21 -04:00
videobuf2-dma-contig.h
videobuf2-dma-sg.h
videobuf2-dvb.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
videobuf2-memops.h
videobuf2-v4l2.h media updates for v4.16-rc1 2018-02-06 11:27:48 -08:00
videobuf2-vmalloc.h
vsp1.h media: vsp1: Support Interlaced display pipelines 2018-08-03 16:02:27 -04:00