mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 20:35:23 +02:00
media: venus: fix use after free in vdec_close
commita0157b5aa3
upstream. 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:af2c3834c8
("[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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2b1aec0e6c
commit
66fa52edd3
|
@ -1747,6 +1747,7 @@ static int vdec_close(struct file *file)
|
||||||
|
|
||||||
vdec_pm_get(inst);
|
vdec_pm_get(inst);
|
||||||
|
|
||||||
|
cancel_work_sync(&inst->delayed_process_work);
|
||||||
v4l2_m2m_ctx_release(inst->m2m_ctx);
|
v4l2_m2m_ctx_release(inst->m2m_ctx);
|
||||||
v4l2_m2m_release(inst->m2m_dev);
|
v4l2_m2m_release(inst->m2m_dev);
|
||||||
vdec_ctrl_deinit(inst);
|
vdec_ctrl_deinit(inst);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user