linux-stable/drivers/media/common
Zhou Qingyang 3af86b0469 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
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>
2021-12-14 15:09:14 +01:00
..
b2c2 media: b2c2: flexcop: Convert to SPDX identifier 2021-12-07 11:29:58 +01:00
saa7146 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2021-12-14 15:09:14 +01:00
siano media: siano: use DEFINE_MUTEX() for mutex lock 2021-09-30 10:07:43 +02:00
v4l2-tpg treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
videobuf2 Linux 5.16-rc4 2021-12-07 11:29:41 +01:00
btcx-risc.h
cx2341x.c media: Rename stateful codec control macros 2020-12-03 12:27:32 +01:00
cypress_firmware.c
cypress_firmware.h
Kconfig media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
Makefile media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
ttpci-eeprom.c media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
ttpci-eeprom.h media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
tveeprom.c