android_kernel_oneplus_msm8998/drivers/media/pci
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
..
b2c2
bt8xx media: bt8xx: Fix err 'bt878_probe()' 2018-03-24 10:58:47 +01:00
cobalt [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
cx18 [media] use v4l2_get_timestamp where possible 2015-10-01 08:29:23 -03:00
cx88 cx88: Fix regression in initial video standard setting 2017-07-27 15:06:06 -07:00
cx23885 media: cx23885: Set subdev host data to clk_freq pointer 2018-05-30 07:49:14 +02:00
cx25821 media: cx25821: prevent out-of-bounds read on array card 2018-05-30 07:49:15 +02:00
ddbridge [media] ddbridge: Do not free_irq() if request_irq() failed 2015-06-09 19:40:33 -03:00
dm1105 media: fix dm1105.c build error 2017-03-12 06:37:24 +01:00
dt3155 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
ivtv [media] Revert "[media] ivtv: avoid going past input/audio array" 2015-12-18 15:25:29 -02:00
mantis [media] mantis: Fix error handling in mantis_dma_init() 2015-08-19 07:04:55 -03:00
meye [media] meye: embed video_device 2015-04-02 23:35:01 -03:00
netup_unidvb various: fix pci_set_dma_mask return value checking 2015-11-20 16:17:32 -08:00
ngene [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
pluto2
pt1 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
pt3 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
saa7134 saa7134: fix warm Medion 7134 EEPROM read 2017-07-15 11:57:50 +02:00
saa7146 [media] saa7146: embed video_device 2015-04-02 23:29:01 -03:00
saa7164 saa7164: fix double fetch PCIe access condition 2017-08-11 09:08:51 -07:00
smipcie [media] SMI PCIe IR driver for DVBSky cards 2015-07-06 08:26:16 -03:00
solo6x10 solo6x10: release vb2 buffers in solo_stop_streaming() 2018-03-22 09:23:21 +01:00
sta2x11 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
ttpci ttpci: address stringop overflow warning 2017-10-08 10:14:20 +02:00
tw68 various: fix pci_set_dma_mask return value checking 2015-11-20 16:17:32 -08:00
zoran [media] zoran: Use monotonic time 2015-08-16 13:29:31 -03:00
Kconfig [media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver 2015-08-11 15:16:40 -03:00
Makefile [media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver 2015-08-11 15:16:40 -03:00