Skip to content

Commit a0157b5

Browse files
Dikshita AgarwalHans Verkuil
authored andcommitted
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: [email protected] Fixes: af2c383 ("[media] media: venus: adding core part and helper functions") Signed-off-by: Dikshita Agarwal <[email protected]> Acked-by: Vikash Garodia <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 193b3da commit a0157b5

File tree

1 file changed

+1
-0
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+1
-0
lines changed

drivers/media/platform/qcom/venus/vdec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,7 @@ static int vdec_close(struct file *file)
17471747

17481748
vdec_pm_get(inst);
17491749

1750+
cancel_work_sync(&inst->delayed_process_work);
17501751
v4l2_m2m_ctx_release(inst->m2m_ctx);
17511752
v4l2_m2m_release(inst->m2m_dev);
17521753
vdec_ctrl_deinit(inst);

0 commit comments

Comments
 (0)