linux/drivers/media
Dikshita Agarwal f27cfdcfc9 media: iris: Fix use-after-free in iris_release_internal_buffers()
The recent change in commit 1dabf00ee2 ("media: iris: gen1: Destroy
internal buffers after FW releases") introduced a regression where
session_release_buf() may free the buffer. The caller,
iris_release_internal_buffers(), continued to access `buffer` after the
call, leading to a potential use-after-free.

Fix this by setting BUF_ATTR_PENDING_RELEASE before calling
session_release_buf(), and reverting the flag if the call fails. This
ensures no dereference occurs after potential freeing.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Closes: https://lore.kernel.org/lkml/aYXvKAX3Pg3sL37P@stanley.mountain/#r
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Fixes: 1dabf00ee2 ("media: iris: gen1: Destroy internal buffers after FW releases")
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
History 2026-04-27 08:41:21 +02:00
..
cec media: rc: fix race between unregister and urb/irq callbacks 2026-03-17 14:43:56 +01:00
common media: uvcvideo: Add support for P010 pixel format 2026-03-25 09:40:28 +01:00
dvb-core [GIT PULL for v7.0-rc3] media fixes 2026-03-04 08:12:06 -08:00
dvb-frontends media: m88ds3103: Implement 3103c chip support 2026-03-25 18:27:25 +01:00
firewire Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
mc media: mc, v4l2: serialize REINIT and REQBUFS with req_queue_mutex 2026-03-18 11:21:31 +01:00
mmc Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci media: cx23885: Module option to disable analog video 2026-03-25 18:27:25 +01:00
platform media: iris: Fix use-after-free in iris_release_internal_buffers() 2026-04-27 08:41:21 +02:00
radio Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rc media: lirc: increase IR_MAX_DURATION to send extended code sequences 2026-03-17 14:43:57 +01:00
spi Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
test-drivers media: vidtv: Use crc32_be() instead of open coding 2026-03-25 18:27:25 +01:00
tuners media: si2157: Include support for si2177 chip 2026-03-25 18:27:25 +01:00
usb [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07:00
v4l2-core [GIT PULL for v7.1] media updates 2026-04-15 08:32:10 -07: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