Message ID | 20230210031354.1335-1-tinghan.shen@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp727117wrn; Thu, 9 Feb 2023 19:27:48 -0800 (PST) X-Google-Smtp-Source: AK7set8lbX2Lq27t//feX0XqKHt0Drya8LYikgEmVXyxCcREyZPjHOf3GsVCw/6h9fKd4aFDJIAk X-Received: by 2002:a17:906:3810:b0:887:dea8:b025 with SMTP id v16-20020a170906381000b00887dea8b025mr14389358ejc.65.1675999668179; Thu, 09 Feb 2023 19:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675999668; cv=none; d=google.com; s=arc-20160816; b=hlnEbgBAHthiEEEVL1MJGVTP/O5c7HrPpoQy3CIWLnSttLSaCIS/+XPsDJZLkMWAKz ayF08DywXZK68y8JNtmONtLWRY8O3KC6hwg9jUl4SGyPClLFJkbR6Nj7lXj3yPfRA8EX lj+/+Y6OY7Blvw3yXxh/sT0ofQWHPdrQSs42sFESsWgwEGIrqPX7TefXdsCJW0FI+WPM DKFgt1aKJoe8W4N22PlEjcoLTXhI97kZTReX0lxRSeFIb1AEW2SsmgDBEOGaApJsh5xX +8RNigyUQt8STlwE1YtQ2FkAK3eGS8VdyGesp31uSUmauHHqfjAtA9gbP6FcBBo2RPxq Fi7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=e/esUzcar84LHIMU9mBAOMspAX9dxk9LWm7hHmIrJC8=; b=Lwxso1jpvbB2i4XDZVuYMVJqryF32whAo28zbuxsXBOOEr8iBmZHaV/swKXT9aXZSw +oiaxb6AJNN4e7rlvpUPDj+oznmDZev/N2HXkBpxPyXktiyhHkga2Hl5QRJJSIz6Jsuj qg/fp0jekbtClDU2hHS9lvGL+u3oY84biKB2w/4yyNoKBP77lp38BofWBrvcEJL0FOT6 SpUmbq5FPaPQXrAmix+MvSWQx++HIB9VcCdx1W2jZZts4NEPr4Nc9vCH2wkG/cCuR2GZ 1sy6/Rkx7Oo8ls63T5H3OfhoyTvH0XxaDO668siHJNN3CwphHRj77jNHW+77pCa+RiYt rjaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Xq3fxDkb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a170906c38a00b00878809a0f92si4083245ejz.541.2023.02.09.19.27.24; Thu, 09 Feb 2023 19:27:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Xq3fxDkb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbjBJDOT (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 22:14:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbjBJDOS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 22:14:18 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C001658EE; Thu, 9 Feb 2023 19:14:13 -0800 (PST) X-UUID: fa5a5faea8f011eda06fc9ecc4dadd91-20230210 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=e/esUzcar84LHIMU9mBAOMspAX9dxk9LWm7hHmIrJC8=; b=Xq3fxDkbf4Mb2MTbQi7aCzQ/E0WUywEoLjJ5S4A+BX8tiQgheFAGi1qbRbU9U1yO5EZkJjQKijUKMQ0m95vvLhPteNCqj+7PjTIutqDHeF67qukghGiwHcGmhOWkdUYTZTK38AVeb8MxIYhaukDYWSDDRDh77eV7i6vzC3TTTCM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:2e5da433-aed7-4dc8-bc48-75436d585a75,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.19,REQID:2e5da433-aed7-4dc8-bc48-75436d585a75,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:885ddb2,CLOUDID:f054db56-dd49-462e-a4be-2143a3ddc739,B ulkID:230210111408UIZKUZNV,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: fa5a5faea8f011eda06fc9ecc4dadd91-20230210 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from <tinghan.shen@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1129734278; Fri, 10 Feb 2023 11:14:06 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 10 Feb 2023 11:14:05 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 10 Feb 2023 11:14:05 +0800 From: Tinghan Shen <tinghan.shen@mediatek.com> To: Bjorn Andersson <andersson@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> CC: <linux-remoteproc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com>, Tinghan Shen <tinghan.shen@mediatek.com> Subject: [PATCH v1] remoteproc: mediatek: Check the SCP image format Date: Fri, 10 Feb 2023 11:13:54 +0800 Message-ID: <20230210031354.1335-1-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757413027796111339?= X-GMAIL-MSGID: =?utf-8?q?1757413027796111339?= |
Series |
[v1] remoteproc: mediatek: Check the SCP image format
|
|
Commit Message
Tinghan Shen
Feb. 10, 2023, 3:13 a.m. UTC
Do a sanity check on the SCP image before loading it to avoid
driver crashes.
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
---
drivers/remoteproc/mtk_scp.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 10/02/2023 04:13, Tinghan Shen wrote: > Do a sanity check on the SCP image before loading it to avoid > driver crashes. > > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > --- > drivers/remoteproc/mtk_scp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index d421a2ccaa1e..0861b76f185f 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -649,6 +649,7 @@ static const struct rproc_ops scp_ops = { > .load = scp_load, > .da_to_va = scp_da_to_va, > .parse_fw = scp_parse_fw, > + .sanity_check = rproc_elf_sanity_check, > }; > > /**
Il 10/02/23 12:32, Matthias Brugger ha scritto: > > > On 10/02/2023 04:13, Tinghan Shen wrote: >> Do a sanity check on the SCP image before loading it to avoid >> driver crashes. >> >> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> > > Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
On Fri, Feb 10, 2023 at 11:13:54AM +0800, Tinghan Shen wrote: > Do a sanity check on the SCP image before loading it to avoid > driver crashes. > > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> > --- > drivers/remoteproc/mtk_scp.c | 1 + > 1 file changed, 1 insertion(+) > I have applied this patch. Thanks, Mathieu > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index d421a2ccaa1e..0861b76f185f 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -649,6 +649,7 @@ static const struct rproc_ops scp_ops = { > .load = scp_load, > .da_to_va = scp_da_to_va, > .parse_fw = scp_parse_fw, > + .sanity_check = rproc_elf_sanity_check, > }; > > /** > -- > 2.18.0 >
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index d421a2ccaa1e..0861b76f185f 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -649,6 +649,7 @@ static const struct rproc_ops scp_ops = { .load = scp_load, .da_to_va = scp_da_to_va, .parse_fw = scp_parse_fw, + .sanity_check = rproc_elf_sanity_check, }; /**