From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web09.210.1621353778696634309 for ; Tue, 18 May 2021 09:02:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@posteo.net header.s=2017 header.b=fl4fJJ7l; spf=pass (domain: posteo.net, ip: 185.67.36.66, mailfrom: sergei@posteo.net) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id A94892400FE for ; Tue, 18 May 2021 18:02:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621353775; bh=+kGdQnqicN8pdEKTo6mo4TGS10cvkYE4270rSNgTtb0=; h=Date:From:To:Cc:Subject:From; b=fl4fJJ7lWzgIKwljkw8K8iQgfBNEWRBWjJCUJZdh27ViUBzLLHnc29gKDUVKANBuw EgGRXUYKfYUycKI27ydT3kBHP1HEvpS94mWRq7ktCKv0D9VUE+oTh0O9NdG+J9HuED 5G3ut8fznhzv0lq3ysgX0+tOmXmL8IUqi3oIn4rBmDEtLMZ6/YYShr7jwmkYlRTv9O Fy45gOFNkBLPNUUraeihatnjD9eNfd6APIVQpMpdi7BCicDqqrW39Gz/zsajSAfOdc TqXwlpVQcnXGjL5pvlyHvmYB5M2rjFIwQvZTu89gRQRc/foSAYXHfm+KGQx/ZRTD8e AX8JOlOvkUoiw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fl14F1dVkz9rxP; Tue, 18 May 2021 18:02:52 +0200 (CEST) Date: Tue, 18 May 2021 16:02:48 +0000 From: "Sergei Dmitrouk" To: devel@edk2.groups.io, gaoliming@byosoft.com.cn Cc: jiewen.yao@intel.com, "'Wang, Jian J'" , "'Lu, XiaoyuX'" , "'Jiang, Guomin'" Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW2VkazItZGV2ZWxdIFtQQVRDSCB2MSAzLzNdIENyeXB0b1BrZy9CYXNlQ3J5cHRMaWI6IEZpeCBwb3NzaWJsZSB1bmluaXRpYWxpemVkIHVzZQ==?= Message-ID: <20210518160248.GA16717@zx-spectrum> References: <20210514121714.17312-1-sergei@posteo.net> <20210514121714.17312-4-sergei@posteo.net> <20210515130041.GA6005@zx-spectrum> <009401d74b81$001f88d0$005e9a70$@byosoft.com.cn> MIME-Version: 1.0 In-Reply-To: <009401d74b81$001f88d0$005e9a70$@byosoft.com.cn> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Yes, adding `-ffat-lto-objects` makes the warning appear even with GCC 5.5.= 0. Regards, Sergei 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 chai= n. > They both work on the different GCC version, such as gcc5, gcc6.. >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90844 mentions > -ffat-lto-objects option that can trig the warning with LTO option. Do y= ou > try it? >=20 > 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.=20 >=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=8815=E6=97= =A5 21:01 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; jiewen.yao@intel.co= m > > =E6=8A=84=E9=80=81: Wang, Jian J ; Lu, XiaoyuX > > ; Jiang, Guomin > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH v1 3/3] CryptoPkg/BaseCryp= tLib: Fix possible > > uninitialized use > >=20 > > Hello Jiewen, > >=20 > > I get the error only for GCC49 and not for GCC5 toolchain. CI uses GC= C5. > >=20 > > So I compared build commands and this seems to depend on LTO. Adding > > `-flto` > > impedes compiler's ability to detect such simple issues. > >=20 > > I've found relevant bug report, there is even fix suggestion from last > month: > >=20 > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90844 > >=20 > > Regards, > > Sergei > >=20 > > 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 obviou= s > logic issue. > > > > > > Do you think we can do anything on CI, to catch it during pre-check-= 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 followi= ng > > > > 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 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20