WSL2-Linux-Kernel/drivers/media
Colin Ian King 604e648e8b media: cx25821: prevent out-of-bounds read on array card
[ Upstream commit 67300abdbe ]

Currently an out of range dev->nr is detected by just reporting the
issue and later on an out-of-bounds read on array card occurs because
of this. Fix this by checking the upper range of dev->nr with the size
of array card (removes the hard coded size), move this check earlier
and also exit with the error -ENOSYS to avoid the later out-of-bounds
array read.

Detected by CoverityScan, CID#711191 ("Out-of-bounds-read")

Fixes: commit 02b20b0b4c ("V4L/DVB (12730): Add conexant cx25821 driver")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: %ld -> %zd]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25 16:17:58 +02:00
..
cec License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
common License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dvb-core media: dmxdev: fix error code for invalid ioctls 2018-05-25 16:17:55 +02:00
dvb-frontends media: lgdt3306a: Fix a double kfree on i2c device remove 2018-05-25 16:17:56 +02:00
firewire
i2c media: i2c: adv748x: fix HDMI field heights 2018-05-25 16:17:57 +02:00
mmc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci media: cx25821: prevent out-of-bounds read on array card 2018-05-25 16:17:58 +02:00
platform media: vivid: fix incorrect capabilities for radio 2018-05-25 16:17:58 +02:00
radio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rc media: rc: partial revert of "media: rc: per-protocol repeat period" 2017-12-14 09:53:00 +01:00
spi
tuners media: r820t: fix r820t_write_reg for KASAN 2018-02-22 15:42:32 +01:00
usb media: em28xx: Add Hauppauge SoloHD/DualHD bulk models 2018-05-25 16:17:57 +02:00
v4l2-core media: vb2: Fix videobuf2 to map correct area 2018-05-25 16:17:57 +02:00
Kconfig media: rc-core: do not depend on MEDIA_SUPPORT 2017-08-20 09:39:36 -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: drop use of MEDIA_API_VERSION 2017-08-08 06:03:15 -04:00
media-devnode.c
media-entity.c media: Make parameter of media_entity_remote_pad() const 2017-07-20 16:54:04 -04:00