Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: venus: fix use after free in vdec_close

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>

authored by

Dikshita Agarwal and committed by
Hans Verkuil
a0157b5a 193b3dac

+1
+1
drivers/media/platform/qcom/venus/vdec.c
··· 1747 1747 1748 1748 vdec_pm_get(inst); 1749 1749 1750 + cancel_work_sync(&inst->delayed_process_work); 1750 1751 v4l2_m2m_ctx_release(inst->m2m_ctx); 1751 1752 v4l2_m2m_release(inst->m2m_dev); 1752 1753 vdec_ctrl_deinit(inst);