]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
media: uvcvideo: Silence shift-out-of-bounds warning
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 18 Aug 2020 23:56:49 +0000 (01:56 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:37 +0000 (14:48 +0100)
commitff7c93def3db706dce78f281c78bb25ad5cbf4f3
treeafbff35d65a930374158349a41cc7917208420c5
parent1fc69d39b704b86de19353a615611bc893055010
media: uvcvideo: Silence shift-out-of-bounds warning

BugLink: https://bugs.launchpad.net/bugs/1902115
[ Upstream commit 171994e498a0426cbe17f874c5c6af3c0af45200 ]

UBSAN reports a shift-out-of-bounds warning in uvc_get_le_value(). The
report is correct, but the issue should be harmless as the computed
value isn't used when the shift is negative. This may however cause
incorrect behaviour if a negative shift could generate adverse side
effects (such as a trap on some architectures for instance).

Regardless of whether that may happen or not, silence the warning as a
full WARN backtrace isn't nice.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/media/usb/uvc/uvc_ctrl.c