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.web11.2372.1621299548259453937 for ; Mon, 17 May 2021 17:59:09 -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 ; Tue, 18 May 2021 08:59:03 +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> In-Reply-To: <20210515130041.GA6005@zx-spectrum> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYxIDMvM10gQ3J5cHRvUGtnL0Jhc2VDcnlwdExpYjogRml4IHBvc3NpYmxlIHVuaW5pdGlhbGl6ZWQgdXNl?= Date: Tue, 18 May 2021 08:59:05 +0800 Message-ID: <009401d74b81$001f88d0$005e9a70$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHv1Mih3XPKyeoWUMbs7k6n1iRLGgIXk0K3AbzNC78CFoI6qaqIAHEg Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Sergei: Yes. GCC49 is LTO disable GCC tool chain. GCC5 is LTO enable tool chain. 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.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA= =B1=ED Sergei > Dmitrouk > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA5=D4=C215=C8=D5 21:01 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; jiewen.yao@intel.com > =B3=AD=CB=CD: Wang, Jian J ; Lu, XiaoyuX > ; Jiang, Guomin > =D6=F7=CC=E2: Re: [edk2-devel] [PATCH v1 3/3] CryptoPkg/BaseCryptLib: Fi= x possible > uninitialized use >=20 > Hello Jiewen, >=20 > I get the error only for GCC49 and not for GCC5 toolchain. CI uses GCC5= . >=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 obvious 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 following > > > 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