linux/drivers/media
Ricardo Ribalda 438bda062b media: uvcvideo: Remove dangling pointers
commit 221cd51efe upstream.

When an async control is written, we copy a pointer to the file handle
that started the operation. That pointer will be used when the device is
done. Which could be anytime in the future.

If the user closes that file descriptor, its structure will be freed,
and there will be one dangling pointer per pending async control, that
the driver will try to use.

Clean all the dangling pointers during release().

To avoid adding a performance penalty in the most common case (no async
operation), a counter has been introduced with some logic to make sure
that it is properly handled.

Cc: stable@vger.kernel.org
Fixes: e5225c820c ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241203-uvc-fix-async-v6-3-26c867231118@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-02-17 10:05:36 +01:00
..
cec media: pulse8-cec: fix data timestamp at pulse8_setup() 2024-10-18 10:43:03 +02:00
common media: videobuf2-core: copy vb planes unconditionally 2024-11-07 12:55:46 +01:00
dvb-core media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set 2024-11-06 22:32:52 +01:00
dvb-frontends media: dvb-frontends: dib3000mb: fix uninit-value in dib3000_write_reg 2025-01-02 10:34:09 +01:00
firewire media: firewire: firedtv-avc.c: replace BUG with proper, error return 2023-08-10 07:58:37 +02:00
i2c media: i2c: ds90ub960: Fix logging SP & EQ status only for UB9702 2025-02-17 10:05:35 +01:00
mc [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
mmc media: mmc: siano: simplify module initialization 2024-04-08 13:48:19 +02:00
pci media: intel/ipu6: remove cpu latency qos request on error 2025-02-17 10:05:33 +01:00
platform media: stm32: dcmipp: correct dma_set_mask_and_coherent mask value 2025-02-17 10:05:34 +01:00
radio media: wl128x: Fix atomicity violation in fmc_send_cmd() 2024-12-05 14:02:56 +01:00
rc media: rc: iguanair: handle timeouts 2025-02-08 09:57:52 +01:00
spi media: gs1662: remove unused struct 'gs_reg_fmt_custom' 2024-05-31 13:51:16 +02:00
test-drivers media: v4l2-core: v4l2-dv-timings: check cvt/gtf result 2024-12-05 14:02:57 +01:00
tuners move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
usb media: uvcvideo: Remove dangling pointers 2025-02-17 10:05:36 +01:00
v4l2-core media: mc: fix endpoint iteration 2025-02-17 10:05:33 +01:00
Kconfig media: Kconfig: Make DVB_CORE=m possible when MEDIA_SUPPORT=y 2022-12-07 17:58:46 +01:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00