Message ID | 20230926101909.15030-1-irui.wang@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2203158vqu; Tue, 26 Sep 2023 14:28:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdoZMgfaOj07oruubeXpn7IQEUz0fahLP+xd05UOwe9MilQBXvwhVnJ+ODohbc18QCsdD/ X-Received: by 2002:a05:6300:8002:b0:161:22c0:541 with SMTP id an2-20020a056300800200b0016122c00541mr86804pzc.25.1695763735801; Tue, 26 Sep 2023 14:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695763735; cv=none; d=google.com; s=arc-20160816; b=IkSqYxaLTo/D7RnHiY95Y3xMvHJkjN4LPQJnXjofjK0RM8cTymYFZsgP/jYcwrvK2c DKVaKtstdU7qsXJSDe2Q2EDO/+5gqM7ZkQ3YEba2Bsockz2x13TPE1LUbSrpVlxqfii1 +Woih6jSTzBcmm+uiyUqxG0kBVw5wERAcPSJqlLi7tFioI60L+CiDcnZZRHCggyEik4R lLXh17oy5/40UsvZdvJ4te958nNBGyujlfLAQn1zqd3W41wOuTNU2Jx1lV7lVnc9h8Cb oygqZlCVB5gcBD3BNpuZ3LZNvzVv4E68Wy71HlDlHR1sZFwe6BcgHrJdjlma9mfsUcna O3Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9pAB4vHxgXuOrF3cQ2v7MgCCwLtC7aUzC54ZVS4HYqQ=; fh=WJAfx7Y229a3xp891GR1A/dZ1Gr8IWcJc0o5HOgLt4c=; b=z6ZhXjuzXVLitSBC/sxgdp3xzrEDmyjxPOMA4+fBzohlrlIS9t3CeHj+WykewiYd57 D0JRX9qbTH17Gi11zSdmuFtbqvpcjiJnbJNLC+XpCoq5dddwa47F98c91TWd5gcFr51C csVwe3wCTfo75ockLdNk5pU7dT9P7ML4xsGX4Luo2XmdyPAy6GKBA48IavwkNmJ4Z5vf LeYc5XHQmSLYR1gr3jYL2bbXJf0cZScH/KFeChW491cOEiFIeoIqgC7mPFtqGnSMa+bR 0Il8byNd3NWid+zEH1KGbMi7MTXEvH97fqbUXNopOSHTic32FJ49GqSZPAHD2x8bVAo6 nM0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=K8bbdp7g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j6-20020a170903024600b001c470c5906bsi14431245plh.221.2023.09.26.14.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 14:28:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=K8bbdp7g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CADCF81A1EAF; Tue, 26 Sep 2023 03:19:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233644AbjIZKTb (ORCPT <rfc822;ruipengqi7@gmail.com> + 27 others); Tue, 26 Sep 2023 06:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjIZKT3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 26 Sep 2023 06:19:29 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C50DBE; Tue, 26 Sep 2023 03:19:21 -0700 (PDT) X-UUID: 23f7105a5c5611ee8051498923ad61e6-20230926 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=9pAB4vHxgXuOrF3cQ2v7MgCCwLtC7aUzC54ZVS4HYqQ=; b=K8bbdp7gq1NlWfol4J5gyjwhwQRd431TAgeFUo+8LQzkjfnkyJwQV7udbjxAInoKdjl/BfdY78D5v5YRqFl0/4hNuLUsjEVhISr/Hr1Rl8Dx3s3oUjl7HXimQ+gO4lmw+sd1oYscZVbI1eiUEntCaXBM9jWYR3cQIWf1Eg5JLaY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:c203cc9a-560b-47d2-864c-7ac8f240f8c7,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:5f78ec9,CLOUDID:5f214abf-14cc-44ca-b657-2d2783296e72,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 23f7105a5c5611ee8051498923ad61e6-20230926 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from <irui.wang@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1048358028; Tue, 26 Sep 2023 18:19:13 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 26 Sep 2023 18:19:11 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 26 Sep 2023 18:19:10 +0800 From: Irui Wang <irui.wang@mediatek.com> To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, Mauro Carvalho Chehab <mchehab@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, <angelogioacchino.delregno@collabora.com>, <nicolas.dufresne@collabora.com>, Yunfei Dong <yunfei.dong@mediatek.com>, Irui Wang <irui.wang@mediatek.com> CC: <Project_Global_Chrome_Upstream_Group@mediatek.com>, <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, Maoguang Meng <maoguang.meng@mediatek.com> Subject: [PATCH 1/2] media: mediatek: vcodec: Fix encoder access NULL pointer Date: Tue, 26 Sep 2023 18:19:08 +0800 Message-ID: <20230926101909.15030-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--5.105600-8.000000 X-TMASE-MatchedRID: GEfnc4mEQr+uhCBFl/b63nQIOMndeKgE5Y0kb0hqatxnerzbhugqspVD ZsT0rYWCzpwM53iUVtXbCHv011Gy9dS7ezKc1AokngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIx1F PlNAAmcDr4JEOMLTOvRaDB3e61dbj0hR2WQtXdazG0iw/N0V7hZ6oP1a0mRIj X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.105600-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: F52746FEAA883B08C25F18637D5B84EC5699F7FD68D85E3D7C3A99FE851EC73F2000:8 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 26 Sep 2023 03:19:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778137155049545841 X-GMAIL-MSGID: 1778137155049545841 |
Series |
[1/2] media: mediatek: vcodec: Fix encoder access NULL pointer
|
|
Commit Message
Irui Wang (王瑞)
Sept. 26, 2023, 10:19 a.m. UTC
Need to set the private data with encoder device, or will access
NULL pointer in encoder handler.
Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")
Signed-off-by: Irui Wang <irui.wang@mediatek.com>
---
drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 26/09/2023 12:19, Irui Wang wrote: > Need to set the private data with encoder device, or will access > NULL pointer in encoder handler. > > Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") > > Signed-off-by: Irui Wang <irui.wang@mediatek.com> > --- > drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > index d299cc2962a5..ae6290d28f8e 100644 > --- a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > @@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu) > vpu->ctx->vpu_inst = vpu; > > status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, vpu->id, > - vpu_enc_ipi_handler, "venc", NULL); > + vpu_enc_ipi_handler, "venc", > + vpu->ctx->dev); > > if (status) { > mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status); Is this a fix that should go to 6.6? Regards, Hans
Il 26/09/23 12:19, Irui Wang ha scritto: > Need to set the private data with encoder device, or will access > NULL pointer in encoder handler. > > Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") > > Signed-off-by: Irui Wang <irui.wang@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Ping! Is this a fix for 6.6 or not? Regards, Hans On 02/10/2023 12:24, Hans Verkuil wrote: > On 26/09/2023 12:19, Irui Wang wrote: >> Need to set the private data with encoder device, or will access >> NULL pointer in encoder handler. >> >> Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") >> >> Signed-off-by: Irui Wang <irui.wang@mediatek.com> >> --- >> drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c >> index d299cc2962a5..ae6290d28f8e 100644 >> --- a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c >> +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c >> @@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu) >> vpu->ctx->vpu_inst = vpu; >> >> status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, vpu->id, >> - vpu_enc_ipi_handler, "venc", NULL); >> + vpu_enc_ipi_handler, "venc", >> + vpu->ctx->dev); >> >> if (status) { >> mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status); > > Is this a fix that should go to 6.6? > > Regards, > > Hans
On 04/10/2023 08:54, Hans Verkuil wrote: > Ping! Is this a fix for 6.6 or not? > > Regards, > > Hans > > On 02/10/2023 12:24, Hans Verkuil wrote: >> On 26/09/2023 12:19, Irui Wang wrote: >>> Need to set the private data with encoder device, or will access >>> NULL pointer in encoder handler. >>> >>> Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") >>> >>> Signed-off-by: Irui Wang <irui.wang@mediatek.com> >>> --- >>> drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c >>> index d299cc2962a5..ae6290d28f8e 100644 >>> --- a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c >>> +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c >>> @@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu) >>> vpu->ctx->vpu_inst = vpu; >>> >>> status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, vpu->id, >>> - vpu_enc_ipi_handler, "venc", NULL); >>> + vpu_enc_ipi_handler, "venc", >>> + vpu->ctx->dev); >>> >>> if (status) { >>> mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status); >> >> Is this a fix that should go to 6.6? This looks like a real bug, so I'll queue this up for 6.6. Regards, Hans
Dear Hans, Sorry for late response, we have just returned to office after vacation. Yes, it's a fix and thank you very much for accepting it. Best Regards On Thu, 2023-10-05 at 10:46 +0200, Hans Verkuil wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > On 04/10/2023 08:54, Hans Verkuil wrote: > > Ping! Is this a fix for 6.6 or not? > > > > Regards, > > > > Hans > > > > On 02/10/2023 12:24, Hans Verkuil wrote: > >> On 26/09/2023 12:19, Irui Wang wrote: > >>> Need to set the private data with encoder device, or will access > >>> NULL pointer in encoder handler. > >>> > >>> Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible > invalid memory access for encoder") > >>> > >>> Signed-off-by: Irui Wang <irui.wang@mediatek.com> > >>> --- > >>> drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 > ++- > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>> > >>> diff --git > a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > >>> index d299cc2962a5..ae6290d28f8e 100644 > >>> --- > a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > >>> +++ > b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c > >>> @@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu) > >>> vpu->ctx->vpu_inst = vpu; > >>> > >>> status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, > vpu->id, > >>> - vpu_enc_ipi_handler, "venc", NULL); > >>> + vpu_enc_ipi_handler, "venc", > >>> + vpu->ctx->dev); > >>> > >>> if (status) { > >>> mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status); > >> > >> Is this a fix that should go to 6.6? > > This looks like a real bug, so I'll queue this up for 6.6. > > Regards, > > Hans
diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c index d299cc2962a5..ae6290d28f8e 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c @@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu) vpu->ctx->vpu_inst = vpu; status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, vpu->id, - vpu_enc_ipi_handler, "venc", NULL); + vpu_enc_ipi_handler, "venc", + vpu->ctx->dev); if (status) { mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status);