]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:19 +0000 (10:07 +0100)
commitfbd50e6e825faa13aa584942458c01e29d7c60c8
tree366b97e9f157e718fbbbb844d8c1059925243a66
parent3eff11b54bac5895eb30b2ba910c22f6083e36b6
media: uvcvideo: Silence shift-out-of-bounds warning

[ 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>
drivers/media/usb/uvc/uvc_ctrl.c