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 fs: fix kernel_read prototype 2017-09-04 19:05:15 -04:00
cx25821-audio-upstream.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-audio.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-biffuncs.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-cards.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-core.c media: cx25821: prevent out-of-bounds read on array card 2018-02-26 08:00:06 -05:00
cx25821-gpio.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-i2c.c media: pci: make i2c_client const 2017-09-23 08:28:03 -04:00
cx25821-medusa-defines.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-medusa-reg.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-medusa-video.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-medusa-video.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-reg.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-sram.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-video-upstream.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-video-upstream.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-video.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821-video.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx25821.h media: cx25821: get rid of CX25821_VERSION_CODE 2017-07-20 16:21:38 -04:00
Kconfig [media] cx25821: convert to vb2 2014-12-23 10:17:47 -02:00
Makefile media: don't include drivers/media/i2c at cflags 2017-12-28 14:14:09 -05:00