1
0
Fork 0
alistair23-linux/drivers/media
Colin Ian King abbe59ca91 media: tda10071: fix unsigned sign extension overflow
[ Upstream commit a7463e2dc6 ]

The shifting of buf[3] by 24 bits to the left will be promoted to
a 32 bit signed int and then sign-extended to an unsigned long. In
the unlikely event that the the top bit of buf[3] is set then all
then all the upper bits end up as also being set because of
the sign-extension and this affect the ev->post_bit_error sum.
Fix this by using the temporary u32 variable bit_error to avoid
the sign-extension promotion. This also removes the need to do the
computation twice.

Addresses-Coverity: ("Unintended sign extension")

Fixes: 267897a470 ("[media] tda10071: implement DVBv5 statistics")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:17:41 +02:00
..
cec cec-api: prevent leaking memory through hole in structure 2020-09-03 11:26:46 +02:00
common media: v4l2-tpg: add support for new pixelformats 2019-07-30 12:16:45 -04:00
dvb-core media: dvbdev: Fix tuner->demod media controller link 2020-06-22 09:30:55 +02:00
dvb-frontends media: tda10071: fix unsigned sign extension overflow 2020-10-01 13:17:41 +02:00
firewire media: firewire: Using uninitialized values in node_probe() 2020-08-19 08:16:10 +02:00
i2c media: smiapp: Fix error handling at NVM reading 2020-10-01 13:17:13 +02:00
mc media: mc-device.c: fix memleak in media_device_register_entity 2020-10-01 13:17:10 +02:00
mmc treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pci media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq() 2020-09-03 11:26:42 +02:00
platform media: ti-vpe: cal: Restrict DMA to avoid memory corruption 2020-10-01 13:17:26 +02:00
radio media: si470x-i2c: add missed operations in remove 2019-12-31 16:45:13 +01:00
rc media: rc: uevent sysfs file races with rc_unregister_device() 2020-09-09 19:12:34 +02:00
spi media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
tuners media: si2157: Better check for running tuner in init 2020-06-22 09:30:50 +02:00
usb media: go7007: Fix URB type for interrupt handling 2020-10-01 13:17:38 +02:00
v4l2-core media: v4l2-core: fix a use-after-free bug of sd->devnode 2020-04-01 11:02:18 +02:00
Kconfig media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
Makefile media: move drivers/media/media-* to drivers/media/mc/mc-* 2019-05-28 12:15:46 -04:00