linux/drivers/media
Murad Masimov f1d518c0ba media: streamzap: fix race between device disconnection and urb callback
[ Upstream commit f656cfbc7a ]

Syzkaller has reported a general protection fault at function
ir_raw_event_store_with_filter(). This crash is caused by a NULL pointer
dereference of dev->raw pointer, even though it is checked for NULL in
the same function, which means there is a race condition. It occurs due
to the incorrect order of actions in the streamzap_disconnect() function:
rc_unregister_device() is called before usb_kill_urb(). The dev->raw
pointer is freed and set to NULL in rc_unregister_device(), and only
after that usb_kill_urb() waits for in-progress requests to finish.

If rc_unregister_device() is called while streamzap_callback() handler is
not finished, this can lead to accessing freed resources. Thus
rc_unregister_device() should be called after usb_kill_urb().

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

Fixes: 8e9e606400 ("V4L/DVB: staging/lirc: port lirc_streamzap to ir-core")
Cc: stable@vger.kernel.org
Reported-by: syzbot+34008406ee9a31b13c73@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=34008406ee9a31b13c73
Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-05-02 07:44:25 +02:00
..
cec media: pulse8-cec: fix data timestamp at pulse8_setup() 2024-11-14 13:13:38 +01:00
common media: siano: Fix error handling in smsdvb_module_init() 2025-05-02 07:43:59 +02:00
dvb-core media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set 2024-12-14 19:50:37 +01:00
dvb-frontends objtool, media: dib8000: Prevent divide-by-zero in dib8000_set_dds() 2025-04-10 14:32:02 +02:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2021-11-06 14:13:30 +01:00
i2c media: i2c: ov7251: Introduce 1 ms delay between regulators and en GPIO 2025-05-02 07:44:01 +02:00
mc media: mc: mark the media devnode as registered from the, start 2024-06-16 13:39:56 +02:00
mmc media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
pci media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) 2024-09-04 13:23:31 +02:00
platform media: venus: hfi_parser: refactor hfi packet parsing logic 2025-05-02 07:44:01 +02:00
radio media: wl128x: Fix atomicity violation in fmc_send_cmd() 2024-12-14 19:51:17 +01:00
rc media: streamzap: fix race between device disconnection and urb callback 2025-05-02 07:44:25 +02:00
spi media: cxd2880-spi: Fix a null pointer dereference on error handling path 2021-11-18 19:16:27 +01:00
test-drivers media: vim2m: print device name after registering device 2025-05-02 07:43:59 +02:00
tuners Revert "media: tuners: fix error return code of hybrid_tuner_request_state()" 2024-10-17 15:11:10 +02:00
usb media: uvcvideo: Remove dangling pointers 2025-03-13 12:51:12 +01:00
v4l2-core media: v4l2-dv-timings: prevent possible overflow in v4l2_detect_gtf() 2025-05-02 07:44:00 +02:00
Kconfig media: correct MEDIA_TEST_SUPPORT help text 2022-01-27 11:05:20 +01:00
Makefile media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00