anolis-cloud-kernel/drivers/media
shaomingyin f272508881 media: dvb-core: Fix use-after-free due on race condition at dvb_net
ANBZ: #14743

[ Upstream commit 4172385b0c ]

A race condition may occur between the .disconnect function, which
is called when the device is disconnected, and the dvb_device_open()
function, which is called when the device node is open()ed.
This results in several types of UAFs.

The root cause of this is that you use the dvb_device_open() function,
which does not implement a conditional statement
that checks 'dvbnet->exit'.

So, add 'remove_mutex` to protect 'dvbnet->exit' and use
locked_dvb_net_open() function to check 'dvbnet->exit'.

[mchehab: fix a checkpatch warning]

Fixes: CVE-2022-45886
Link: https://lore.kernel.org/linux-media/20221117045925.14297-3-imv4bel@gmail.com
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/5341
2025-05-27 09:48:29 +00:00
..
cec media: cec-adap.c: fix is_configuring state 2022-06-09 10:20:55 +02:00
common media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 10:54:16 +01:00
dvb-core media: dvb-core: Fix use-after-free due on race condition at dvb_net 2025-05-27 09:48:29 +00:00
dvb-frontends media: dib8000: Fix a memleak in dib8000_init() 2022-01-27 10:53:54 +01:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2021-11-06 14:10:09 +01:00
i2c media: ov7670: remove ov7670_power_off from ov7670_remove 2022-06-09 10:21:10 +02:00
mc media: Fix Media Controller API config checks 2021-07-14 16:55:56 +02:00
mmc
pci media: saa7134: fix use after free bug in saa7134_finidev due to race condition 2023-07-27 23:32:21 +00:00
platform anolis: Revert "dmaengine: Remove the last, used parameters in dma_async_is_tx_complete" 2024-06-03 11:32:38 +00:00
radio media: si470x-i2c: fix possible memory leak in si470x_i2c_probe() 2022-01-27 10:53:51 +01:00
rc media: mceusb: Use new usb_control_msg_*() routines 2023-10-23 00:12:06 +00:00
spi media: cxd2880-spi: Fix a null pointer dereference on error handling path 2021-11-18 14:04:04 +01:00
test-drivers media: vivid: dev->bitmap_cap wasn't freed in all cases 2023-10-25 07:34:43 +00:00
tuners media: msi001: fix possible null-ptr-deref in msi001_probe() 2022-01-27 10:53:56 +01:00
usb media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in uvc_parse_format 2025-02-17 18:06:21 +08:00
v4l2-core media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls 2022-04-08 14:40:05 +02:00
Kconfig media: correct MEDIA_TEST_SUPPORT help text 2022-01-27 10:54:29 +01:00
Makefile