summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-04-08 05:52:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:46:18 -0700
commit11ad52770a42b1fdf2d6d04432f3da5b43295e94 (patch)
tree97862ccd7ca3823782faa3208f382ae66e583885 /drivers/iio
parenta90ce66af211e7130d1298669387c865daa05caf (diff)
downloadlinux-stable-11ad52770a42b1fdf2d6d04432f3da5b43295e94.tar.gz
linux-stable-11ad52770a42b1fdf2d6d04432f3da5b43295e94.tar.bz2
linux-stable-11ad52770a42b1fdf2d6d04432f3da5b43295e94.zip
media: pvrusb2: Prevent a buffer overflow
[ Upstream commit c1ced46c7b49ad7bc064e68d966e0ad303f917fb ] The ctrl_check_input() function is called from pvr2_ctrl_range_check(). It's supposed to validate user supplied input and return true or false depending on whether the input is valid or not. The problem is that negative shifts or shifts greater than 31 are undefined in C. In practice with GCC they result in shift wrapping so this function returns true for some inputs which are not valid and this could result in a buffer overflow: drivers/media/usb/pvrusb2/pvrusb2-ctrl.c:205 pvr2_ctrl_get_valname() warn: uncapped user index 'names[val]' The cptr->hdw->input_allowed_mask mask is configured in pvr2_hdw_create() and the highest valid bit is BIT(4). Fixes: 7fb20fa38caa ("V4L/DVB (7299): pvrusb2: Improve logic which handles input choice availability") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/iio')
0 files changed, 0 insertions, 0 deletions