linux/drivers/media/pci/cx25821
Colin Ian King 67300abdbe media: cx25821: prevent out-of-bounds read on array card
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>
2018-02-26 08:00:06 -05:00
..
cx25821-alsa.c media: cx25821-alsa: fix usage of a pointer printk 2017-12-11 13:04:56 -05:00
cx25821-audio-upstream.c
cx25821-audio-upstream.h
cx25821-audio.h
cx25821-biffuncs.h
cx25821-cards.c
cx25821-core.c media: cx25821: prevent out-of-bounds read on array card 2018-02-26 08:00:06 -05:00
cx25821-gpio.c
cx25821-i2c.c media: pci: make i2c_client const 2017-09-23 08:28:03 -04:00
cx25821-medusa-defines.h
cx25821-medusa-reg.h
cx25821-medusa-video.c
cx25821-medusa-video.h
cx25821-reg.h
cx25821-sram.h
cx25821-video-upstream.c
cx25821-video-upstream.h
cx25821-video.c
cx25821-video.h
cx25821.h
Kconfig
Makefile media: don't include drivers/media/i2c at cflags 2017-12-28 14:14:09 -05:00