From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web10.5601.1621387565717774365 for ; Tue, 18 May 2021 18:26:06 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 19 May 2021 09:26:01 +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: , Cc: , "'Wang, Jian J'" , "'Lu, XiaoyuX'" , "'Jiang, Guomin'" References: <20210514121714.17312-1-sergei@posteo.net> <20210514121714.17312-4-sergei@posteo.net> <20210515130041.GA6005@zx-spectrum> <009401d74b81$001f88d0$005e9a70$@byosoft.com.cn> <20210518160248.GA16717@zx-spectrum> In-Reply-To: <20210518160248.GA16717@zx-spectrum> Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0ggdjEgMy8zXSBDcnlwdG9Qa2cvQmFzZUNyeXB0TGliOiBGaXggcG9zc2libGUgdW5pbml0aWFsaXplZCB1c2U=?= Date: Wed, 19 May 2021 09:26:03 +0800 Message-ID: <000401d74c4d$ef1b8570$cd529050$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHv1Mih3XPKyeoWUMbs7k6n1iRLGgIXk0K3AbzNC78CFoI6qQHYLqxZAm9D4hyqZ16scA== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Sergei: Thanks for your confirmation. I will send the patch to update GCC5 tool = chain with this option.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Sergei > Dmitrouk > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B45=E6=9C=8819=E6=97=A5= 0:03 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.com= .cn > =E6=8A=84=E9=80=81: jiewen.yao@intel.com; 'Wang, Jian J' ; 'Lu, > XiaoyuX' ; 'Jiang, Guomin' > =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH v1 3/3] = CryptoPkg/BaseCryptLib: Fix > possible uninitialized use >=20 > Yes, adding `-ffat-lto-objects` makes the warning appear even with GCC 5= .5.0. >=20 > Regards, > Sergei >=20 > On Tue, May 18, 2021 at 08:59:05AM +0800, gaoliming wrote: > > Sergei: > > Yes. GCC49 is LTO disable GCC tool chain. GCC5 is LTO enable tool ch= ain. > > They both work on the different GCC version, such as gcc5, gcc6.. > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90844 mentions > > -ffat-lto-objects option that can trig the warning with LTO option. Do= you > > try it? > > > > If this option works, we can update GCC5 tool chain definition in > > tools_def.txt, then this issue can be detected in CI GCC5 build. > > > > Thanks > > Liming > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Sergei > > > Dmitrouk > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B45=E6=9C=8815=E6= =97=A5 21:01 > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; jiewen.yao@intel.= com > > > =E6=8A=84=E9=80=81: Wang, Jian J ; Lu, Xiaoyu= X > > > ; Jiang, Guomin > > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH v1 3/3] CryptoPkg/BaseCr= yptLib: Fix > possible > > > uninitialized use > > > > > > Hello Jiewen, > > > > > > I get the error only for GCC49 and not for GCC5 toolchain. CI uses = GCC5. > > > > > > So I compared build commands and this seems to depend on LTO. Addin= g > > > `-flto` > > > impedes compiler's ability to detect such simple issues. > > > > > > I've found relevant bug report, there is even fix suggestion from la= st > > month: > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90844 > > > > > > Regards, > > > Sergei > > > > > > On Sat, May 15, 2021 at 12:30:44AM +0000, Yao, Jiewen wrote: > > > > Hi Sergei > > > > Thank you very much for the fix. > > > > Reviewed-by: Jiewen Yao > > > > > > > > I am a little surprised why it is not caught before. It is an obvi= ous > > logic issue. > > > > > > > > Do you think we can do anything on CI, to catch it during pre-chec= k-in > > in the > > > future? > > > > I just feel it is burden to make it post-check-in fix. > > > > > > > > > > > > Thank you > > > > Yao Jiewen > > > > > > > > > -----Original Message----- > > > > > From: Sergei Dmitrouk > > > > > Sent: Friday, May 14, 2021 8:17 PM > > > > > To: devel@edk2.groups.io > > > > > Cc: Yao, Jiewen ; Wang, Jian J > > > ; > > > > > Lu, XiaoyuX ; Jiang, Guomin > > > > > > > > Subject: [PATCH v1 3/3] CryptoPkg/BaseCryptLib: Fix possible > > uninitialized > > > use > > > > > > > > > > `Result` can be used uninitialized in both functions after follo= wing > > > > > either first or second `goto` statement. > > > > > > > > > > Cc: Jiewen Yao > > > > > Cc: Jian J Wang > > > > > Cc: Xiaoyu Lu > > > > > Cc: Guomin Jiang > > > > > Signed-off-by: Sergei Dmitrouk > > > > > --- > > > > > CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c | 1 + > > > > > CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c | 1 + > > > > > 2 files changed, 2 insertions(+) > > > > > > > > > > diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c > > > > > b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c > > > > > index 4009d37d5f91..0b2960f06c4c 100644 > > > > > --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c > > > > > +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPss.c > > > > > @@ -82,6 +82,7 @@ RsaPssVerify ( > > > > > EVP_PKEY_CTX *KeyCtx; > > > > > CONST EVP_MD *HashAlg; > > > > > > > > > > + Result =3D FALSE; > > > > > EvpRsaKey =3D NULL; > > > > > EvpVerifyCtx =3D NULL; > > > > > KeyCtx =3D NULL; > > > > > diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c > > > > > b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c > > > > > index b66b6f7296ad..ece765f9ae0a 100644 > > > > > --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c > > > > > +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaPssSign.c > > > > > @@ -97,6 +97,7 @@ RsaPssSign ( > > > > > EVP_PKEY_CTX *KeyCtx; > > > > > CONST EVP_MD *HashAlg; > > > > > > > > > > + Result =3D FALSE; > > > > > EvpRsaKey =3D NULL; > > > > > EvpVerifyCtx =3D NULL; > > > > > KeyCtx =3D NULL; > > > > > -- > > > > > 2.17.6 > > > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20