From: Irui Wang irui.wang@mediatek.com
mainline inclusion from mainline-v6.11-rc1 commit 59d438f8e02ca641c58d77e1feffa000ff809e9f category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAKQ2F CVE: CVE-2024-43831
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is valid for future use.
Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
Signed-off-by: Irui Wang irui.wang@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Sebastian Fricke sebastian.fricke@collabora.com Signed-off-by: Hans Verkuil hverkuil-cisco@xs4all.nl Conflicts: drivers/media/platform/mtk-vcodec/vdec_vpu_if.c [vpu_dec_init is moved from drivers/media/platform/mtk-vcodec/vdec_vpu_if.c to drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c. Using mtk_vcodec_err instead of mtk_vdec_err becuase 0db2fc4eec23e4c92abee357e98d9f97998098b4 is not merged] Signed-off-by: Cai Xinchen caixinchen1@huawei.com --- drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c index 58b0e6fa8fd2..93d40f0e0f79 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c @@ -127,6 +127,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu) mtk_vcodec_debug(vpu, "vdec_inst=%p", vpu);
err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg)); + + if (IS_ERR_OR_NULL(vpu->vsi)) { + mtk_vcodec_err(vpu, "invalid vdec vsi, status=%d", err); + return -EINVAL; + } + mtk_vcodec_debug(vpu, "- ret=%d", err); return err; }
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/11013 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/U...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/11013 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/U...