2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 03:04:01 +08:00
linux-next/drivers/media
Daniel Scheller 525cac7574 media: ddbridge/mci: protect against out-of-bounds array access in stop()
In stop(), an (unlikely) out-of-bounds write error can occur when setting
the demod_in_use element indexed by state->demod to zero, as state->demod
isn't checked for being in the range of the array size of demod_in_use, and
state->demod maybe carrying the magic 0xff (demod unused) value. Prevent
this by checking state->demod not exceeding the array size before setting
the element value. To make the code a bit easier to read, replace the magic
value and the number of array elements with defines, and use them at a few
more places.

Detected by CoverityScan, CID#1468550 ("Out-of-bounds write")

Thanks to Colin for reporting the problem and providing an initial patch.

Fixes: daeeb1319e ("media: ddbridge: initial support for MCI-based MaxSX8 cards")

Reported-by: Colin Ian King <colin.king@canonical.com>
Cc: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-28 17:43:20 -04:00
..
cec media: cec: fix wrong tx/rx_status values when canceling a msg 2018-05-28 16:25:25 -04:00
common media: Remove depends on HAS_DMA in case of platform dependency 2018-05-28 16:17:08 -04:00
dvb-core media: dvb_ca_en50221: prevent using slot_info for Spectre attacs 2018-05-16 10:17:22 -04:00
dvb-frontends media: au8522: remove duplicate code 2018-05-28 16:26:38 -04:00
firewire vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
i2c media: adv7511: fix incorrect clear of CEC receive interrupt 2018-05-28 16:25:45 -04:00
mmc media: siano: use GFP_DMA only for smssdio 2018-05-15 08:04:42 -04:00
pci media: ddbridge/mci: protect against out-of-bounds array access in stop() 2018-05-28 17:43:20 -04:00
platform media: pxa_camera: avoid duplicate s_power calls 2018-05-28 16:24:30 -04:00
radio Linux 4.17-rc4 2018-05-10 07:19:23 -04:00
rc media: rc: ensure input/lirc device can be opened after register 2018-05-28 17:40:33 -04:00
spi media: cxd2880-spi: Modified how to declare structure 2018-05-05 10:37:12 -04:00
tuners Linux 4.17-rc4 2018-05-10 07:19:23 -04:00
usb media: uvcvideo: Support realtek's UVC 1.5 device 2018-05-28 16:59:55 -04:00
v4l2-core media: v4l2-core: push taking ioctl mutex down to ioctl handler 2018-05-28 16:31:44 -04:00
Kconfig media: cec: Kconfig coding style issue 2018-05-09 16:26:50 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
media-device.c media: media-device: fix ioctl function types 2018-05-09 16:33:46 -04:00
media-devnode.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
media-entity.c media: media.h: reorganize header to make it easier to understand 2018-02-26 10:14:46 -05:00