From nobody Mon Nov 25 07:48:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+73927+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+73927+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1618191426; cv=none; d=zohomail.com; s=zohoarc; b=ikNFzSDQFzSIf504GvPqteo1DS21PK5ihSOqQFUIIBuuDLoTXGOKWxth8wqw9GOU9OcqJXPXy9mZ87CBsNyqDioFTmQFmeaAgWyPI2ulydjQwhh3vNmERCZkYji/n/ENYa97VD7I1CwYukbvEKkae05JBkiPJkJdnafqa7+zmYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618191426; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vv+w4OZX+ZVEI2FcAIs/LaY7rKwom55exjowHZkVToQ=; b=YlRU5MWlc5zDIRVIl4hv6tQSiXrewcXW3Dk5O918dCmWWjhAJalCzAZZRx0fKngWd/qN3LhbAjmc1/F4qYNbgb4k9h9OLWGBJvtapC1cpha9WMbudjQnXmfgltyQQ/8qw+wJIhzQx7aKPhTz1cxLcdO508d7w0pUweIrM8EhJGo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+73927+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1618191426889732.8890579623182; Sun, 11 Apr 2021 18:37:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id sYmgYY1788612xACtWRIMn2g; Sun, 11 Apr 2021 18:37:06 -0700 X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.26255.1618191420356748668 for ; Sun, 11 Apr 2021 18:37:01 -0700 X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 12 Apr 2021 09:36:47 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Bret Barkelew'" , , Cc: "'Jian J Wang'" , "'Hao A Wu'" References: <20210409182511.620-1-bret.barkelew@microsoft.com> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbRVhURVJOQUxdIFtlZGsyLWRldmVsXSBbUEFUQ0ggdjEgMS8xXSBNZGVNb2R1bGVQa2c6IEluaXRpYWxpemUgdGVtcCB2YXJpYWJsZSBpbiBWYXJDaGVja1BvbGljeUxpYg==?= Date: Mon, 12 Apr 2021 09:36:55 +0800 Message-ID: <006901d72f3c$5257d4b0$f7077e10$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQHdNHHHFeB2PRK9x9MK4ZZQwwfqrgJ8r8LZqpAp9OA= Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn X-Gm-Message-State: uu1ZFEG1ivJa0MXPitCdf0SPx1787277AA= Content-Type: multipart/alternative; boundary="----=_NextPart_000_006A_01D72F7F.607BFF10" Content-Language: zh-cn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1618191426; bh=tp3YQv0liBMzfo7TFixR55yAUKevca4HEi+oCcEKg40=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=I/CNnK1NgUOLpKy1HKwDMwaGoMGUYvIOt0mkotyYTVemPUINQox6mI2vF0UMkNGcEdX 2z0Nd57N429F51knZZ96N9nOXLzyGdb6VDhxJeXYl6JKEgkIpzy2lBXe2yLFw0gjkGy1V 5gmnE6/CQ0ctuHX/QaFWI9j8rcNy4b8Njso= X-ZohoMail-DKIM: pass (identity @groups.io) ------=_NextPart_000_006A_01D72F7F.607BFF10 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Bret: This fix is correct. I am interest that why the compiler doesn=E2=80=99t d= etect this issue. =20 Reviewed-by: Liming Gao =20 Thanks Liming =E5=8F=91=E4=BB=B6=E4=BA=BA: Bret Barkelew =20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B44=E6=9C=8810=E6=97=A5 2:= 34 =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; bret@corthon.com; Liming= Gao =E6=8A=84=E9=80=81: Jian J Wang ; Hao A Wu =E4=B8=BB=E9=A2=98: RE: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg= : Initialize temp variable in VarCheckPolicyLib =20 + @Liming Gao =20 - Bret=20 =20 From: Bret Barkelew via groups.io =20 Sent: Friday, April 9, 2021 11:25 AM To: devel@edk2.groups.io =20 Cc: Jian J Wang ; Hao A Wu =20 Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize temp variable in VarCheckPolicyLib =20 DumpVariablePolicy() will return EFI_INVALID_PARAMETER if the Buffer pointer is NULL and the indirect Size is anything but 0. Since this TempSize was not being initialized it is very likely that this sequence would not return the total buffer size as expected. Bugzilla: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzill= a.t ianocore.org%2Fshow_bug.cgi%3Fid%3D3310 &data=3D04%7C01%7CBret.Barkelew%40microsoft.com%7C3d2f574a01a048aed6070= 8d8 fb84dcbb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637535895350828079%7CU nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ XVCI6Mn0%3D%7C1000&sdata=3Dj6KmN6jcwoGJlunjspLawLJtYqCwGWw18pXNZVMNdC8%= 3D& amp;reserved=3D0 Cc: Jian J Wang > Cc: Hao A Wu > Signed-off-by: Bret Barkelew > --- MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c index 14e1904e96d3..e50edb4ffc5a 100644 --- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c +++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c @@ -216,6 +216,7 @@ VarCheckPolicyLibMmiHandler ( DumpParamsOut->TotalSize =3D 0; DumpParamsOut->PageSize =3D 0; DumpParamsOut->HasMore =3D FALSE; + TempSize =3D 0; SubCommandStatus =3D DumpVariablePolicy (NULL, &TempSize); if (SubCommandStatus =3D=3D EFI_BUFFER_TOO_SMALL && TempSize > 0) { mCurrentPaginationCommand =3D VAR_CHECK_POLICY_COMMAND_DUMP; --=20 2.28.0.windows.1 =20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#73927): https://edk2.groups.io/g/devel/message/73927 Mute This Topic: https://groups.io/mt/82028626/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- ------=_NextPart_000_006A_01D72F7F.607BFF10 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Bret:

 This fix is corre= ct. I am interest that why the compiler doesn=A1=AFt detect this issue. &nb= sp;

 

Reviewed-by: Liming Gao <gaoliming@by= osoft.com.cn>

 =

Thanks

Liming=

=B7=A2=BC=FE=C8=CB:<= span lang=3DEN-US style=3D'font-family:DengXian'> Bret Barkelew <Bret.Ba= rkelew@microsoft.com>
=B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA4=D4=C210= =C8=D5 2:34
=CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; bret@cor= thon.com; Liming Gao <gaoliming@byosoft.com.cn>
=B3=AD= =CB=CD: Jian J Wang <j= ian.j.wang@intel.com>; Hao A Wu <hao.a.wu@intel.com>
= = =D6=F7=CC=E2: RE: [EXTERN= AL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize temp variable in V= arCheckPolicyLib

 

+ @Liming Gao

 

- Bret

 

From: Bret Barkelew via groups.io
Sen= t: Friday, April 9, 2021 11:25 AM
To: devel@edk2.groups.io
Cc: Jian J Wang; Hao A Wu
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] Md= eModulePkg: Initialize temp variable in VarCheckPolicyLib
=

 <= /p>

D= umpVariablePolicy() will return EFI_INVALID_PARAMETER if the Buffer
poin= ter is NULL and the indirect Size is anything but 0. Since this
TempSize= was not being initialized it is very likely that this sequence
would no= t return the total buffer size as expected.

Bugzilla: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzi= lla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3310&amp;data=3D04%7C01%7CBret.= Barkelew%40microsoft.com%7C3d2f574a01a048aed60708d8fb84dcbb%7C72f988bf86f14= 1af91ab2d7cd011db47%7C1%7C0%7C637535895350828079%7CUnknown%7CTWFpbGZsb3d8ey= JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&= ;amp;sdata=3Dj6KmN6jcwoGJlunjspLawLJtYqCwGWw18pXNZVMNdC8%3D&amp;reserve= d=3D0

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Bret Barkelew = <bret.barkelew@microsoft.= com>
---
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheck= PolicyLib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git= a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c b/MdeModulePk= g/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
index 14e1904e96d3..e50e= db4ffc5a 100644
--- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPol= icyLib.c
+++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.= c
@@ -216,6 +216,7 @@ VarCheckPolicyLibMmiHandler (
   = ;      DumpParamsOut->TotalSize =3D 0;
 = ;        DumpParamsOut->PageSize =3D = 0;
         DumpParamsOut->Ha= sMore =3D FALSE;
+        TempSize = =3D 0;
         SubCommandStatu= s =3D DumpVariablePolicy (NULL, &TempSize);
    =      if (SubCommandStatus =3D=3D EFI_BUFFER_TOO_SMALL &= amp;& TempSize > 0) {
       &= nbsp;   mCurrentPaginationCommand =3D VAR_CHECK_POLICY_COMMAND_DU= MP;
--
2.28.0.windows.1



 

_._,_._,_

= Groups.io Links:

You receive all messages sent to this group.

<= a target=3D"_blank" href=3D"https://edk2.groups.io/g/devel/message/73927">V= iew/Reply Online (#73927) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [importer@patchew.org]
_._,_._,_=20 ------=_NextPart_000_006A_01D72F7F.607BFF10--