WSL2-Linux-Kernel/drivers/media/common/saa7146
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
..
Kconfig
Makefile
saa7146_core.c media: saa7146: use sg_dma_len when building pgtable 2021-03-11 11:59:44 +01:00
saa7146_fops.c media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 11:04:42 +01:00
saa7146_hlp.c
saa7146_i2c.c
saa7146_vbi.c media: saa7146: switch from 'pci_' to 'dma_' API 2020-12-03 08:57:07 +01:00
saa7146_video.c media: saa7146: use sg_dma_len when building pgtable 2021-03-11 11:59:44 +01:00