linux-stable/drivers/media/pci
Zhou Qingyang c3d14b3585 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
[ Upstream commit 3af86b0469 ]

In hexium_attach(dev, info), saa7146_vv_init() is called to allocate
a new memory for dev->vv_data. saa7146_vv_release() will be called on
failure of saa7146_register_device(). There is a dereference of
dev->vv_data in saa7146_vv_release(), which could lead to a NULL
pointer dereference on failure of saa7146_vv_init().

Fix this bug by adding a check of saa7146_vv_init().

This bug was found by a static analyzer. The analysis employs
differential checking to identify inconsistent security operations
(e.g., checks or kfrees) between two code paths and confirms that the
inconsistent operations are not recovered in the current function or
the callers, so they constitute bugs.

Note that, as a bug found by static analysis, it can be a false
positive or hard to trigger. Multiple researchers have cross-reviewed
the bug.

Builds with CONFIG_VIDEO_HEXIUM_GEMINI=m show no new warnings,
and our static analyzer no longer warns about this code.

Link: https://lore.kernel.org/linux-media/20211203154030.111210-1-zhou1615@umn.edu
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:04:42 +01:00
..
b2c2 media: b2c2: Add missing check in flexcop_pci_isr: 2022-01-27 11:04:27 +01:00
bt8xx bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
cobalt media: cobalt: fix race condition in setting HPD 2021-05-19 09:51:39 +02:00
cx18 media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
cx88 media: pci: cx88: switch from 'pci_' to 'dma_' API 2021-06-17 10:24:41 +02:00
cx23885 media: cx23885: Fix snd_card_free call on null card pointer 2021-11-18 19:16:29 +01:00
cx25821 media updates for v5.13-rc1 2021-04-28 09:24:36 -07:00
ddbridge
dm1105 media: dm1105: switch from 'pci_' to 'dma_' API 2020-11-27 14:10:07 +01:00
dt3155
intel media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor() 2021-08-26 18:52:30 +02:00
ivtv media: ivtv: fix build for UML 2021-11-18 19:16:34 +01:00
mantis media: mantis: remove orphan mantis_core.c 2021-03-22 17:27:13 +01:00
meye
netup_unidvb media: netup_unidvb: handle interrupt properly according to the firmware 2021-11-18 19:16:12 +01:00
ngene media: ngene: Fix out-of-bounds bug in ngene_command_config_free_buf() 2021-07-19 19:33:46 -05:00
pluto2
pt1 media: media/pci/pt1: Assign value when defining variables 2021-03-22 13:04:05 +01:00
pt3
saa7134 media: saa7134: convert list_for_each to entry variant 2021-07-12 09:16:37 +02:00
saa7146 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 11:04:42 +01:00
saa7164 media: saa7164: remove redundant continue statement 2021-07-12 09:16:38 +02:00
smipcie media: smipcie: fix interrupt handling and IR timeout 2021-02-05 23:41:25 +01:00
solo6x10 media: solo6x10: Switch to using the new API kobj_to_dev() 2021-03-11 11:59:43 +01:00
sta2x11 media updates for v5.13-rc1 2021-04-28 09:24:36 -07:00
ttpci media: ttpci: switch from 'pci_' to 'dma_' API 2021-06-02 13:16:55 +02:00
tw68 media: tw68: switch from 'pci_' to 'dma_' API 2021-04-06 16:07:42 +02:00
tw686x media: tw686x: switch from 'pci_' to 'dma_' API 2021-04-06 16:07:26 +02:00
tw5864 media: drivers/media/pci/tw5864/Tw5864-reg.h: fix typo issues 2021-07-12 09:16:33 +02:00
Kconfig
Makefile