android_kernel_oneplus_msm8998/drivers/media
Colin Ian King a56d9386c0 media: cx25821: prevent out-of-bounds read on array card
[ Upstream commit 67300abdbe9f1717532aaf4e037222762716d0f6 ]

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-30 07:49:15 +02:00
..
common b2c2: flexcop: avoid unused function warnings 2018-02-25 11:03:48 +01:00
dvb-core media: dmxdev: fix error code for invalid ioctls 2018-05-30 07:49:01 +02:00
dvb-frontends media: [RESEND] media: dvb-frontends: Add delay to Si2168 restart 2018-03-24 10:58:47 +01:00
firewire [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
i2c cx25840: fix unchecked return values 2018-04-13 19:50:18 +02:00
mmc
pci media: cx25821: prevent out-of-bounds read on array card 2018-05-30 07:49:15 +02:00
platform media: s3c-camif: fix out-of-bounds array access 2018-05-30 07:49:14 +02:00
radio [media] radio: Drop owner assignment from i2c_driver 2015-08-11 13:01:08 -03:00
rc mceusb: sporadic RX truncation corruption fix 2018-04-13 19:50:18 +02:00
tuners media: r820t: fix r820t_write_reg for KASAN 2018-02-22 15:45:02 +01:00
usb media: em28xx: USB bulk packet size fix 2018-05-30 07:49:14 +02:00
v4l2-core media: v4l2-compat-ioctl32: don't oops on overlay 2018-04-24 09:32:03 +02:00
Kconfig media updates for v4.2-rc1 2015-06-25 17:55:48 -07:00
Makefile
media-device.c
media-devnode.c
media-entity.c [media] media-entity.c: get rid of var length arrays 2015-10-01 18:10:05 -03:00