All of lore.kernel.org
 help / color / mirror / Atom feed
* [git:media_stage/master] media: venus: fix use after free in vdec_close
@ 2024-06-30  9:22 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2024-06-30  9:22 UTC (permalink / raw)
  To: linuxtv-commits
  Cc: Dikshita Agarwal, Stanimir Varbanov, stable, Vikash Garodia

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: venus: fix use after free in vdec_close
Author:  Dikshita Agarwal <quic_dikshita@quicinc.com>
Date:    Thu May 9 10:44:29 2024 +0530

There appears to be a possible use after free with vdec_close().
The firmware will add buffer release work to the work queue through
HFI callbacks as a normal part of decoding. Randomly closing the
decoder device from userspace during normal decoding can incur
a read after free for inst.

Fix it by cancelling the work in vdec_close.

Cc: stable@vger.kernel.org
Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Acked-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

 drivers/media/platform/qcom/venus/vdec.c | 1 +
 1 file changed, 1 insertion(+)

---

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 0d2ab95bec0f..d12089370d91 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1747,6 +1747,7 @@ static int vdec_close(struct file *file)
 
 	vdec_pm_get(inst);
 
+	cancel_work_sync(&inst->delayed_process_work);
 	v4l2_m2m_ctx_release(inst->m2m_ctx);
 	v4l2_m2m_release(inst->m2m_dev);
 	vdec_ctrl_deinit(inst);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-30  9:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-30  9:22 [git:media_stage/master] media: venus: fix use after free in vdec_close Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.