From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web08.5305.1621322804424283902 for ; Tue, 18 May 2021 00:26:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LV3paeoK; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 5E57861261 for ; Tue, 18 May 2021 07:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621322803; bh=/HoGWxfaGP8wZ/GEORLXgDr+YKi3PoD3d4kbGKLBspA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LV3paeoKe8PJ8Apb/H2CG6zQYhb5bOQMrmKQOsPDg2VKuTWnHc7R9J2R7zbzvu+Z/ ZvMloToeTIkX/dRxhjBal3s93ksS9mw3YrODHXl8qGoIDDt4iX/k9oiBjIE7SaKSXx C3TdyKuQWybNr6kWHKbzwmBerTWxUEGw7geXiwNTHkpzomZj0xNnM8Msak1XItFaOX QAYiHZHi4YA4oMFe9YWgettijupF8EMGwTjx+FKd287x9M5gcy2bo4+/raw/FqnhOy woSA8jNVr7eUtxp4eYAytxoK6KtfANU4isH9JGoKTHFRgvLPF4o2yeQ+YSznl71nK0 IRSaBchF0eXIg== Received: by mail-oo1-f43.google.com with SMTP id q17-20020a4a33110000b029020ebab0e615so106437ooq.8 for ; Tue, 18 May 2021 00:26:43 -0700 (PDT) X-Gm-Message-State: AOAM533i3ISlp6uSov052WdtgQDf1DFyF+RKVjm/PfMmYZrHMu4eQQDS E/BjpTpfmW2J7UprlBORm9Mhhb0kKjSmOpfaPZM= X-Google-Smtp-Source: ABdhPJxqRe4N3cFPwVK0Qp5JklgpTgN/JJy/2+6qAFoJmw8vnhWksU418KEE56e4jTJeQRjoVC0+5E9eUabw4p1o+vo= X-Received: by 2002:a4a:b202:: with SMTP id d2mr3214278ooo.13.1621322802738; Tue, 18 May 2021 00:26:42 -0700 (PDT) MIME-Version: 1.0 References: <20210514121714.17312-1-sergei@posteo.net> <20210514121714.17312-4-sergei@posteo.net> <20210515130041.GA6005@zx-spectrum> <009401d74b81$001f88d0$005e9a70$@byosoft.com.cn> In-Reply-To: <009401d74b81$001f88d0$005e9a70$@byosoft.com.cn> From: "Ard Biesheuvel" Date: Tue, 18 May 2021 09:26:31 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v1 3/3] CryptoPkg/BaseCryptLib: Fix possible uninitialized use To: edk2-devel-groups-io , "Liming Gao (Byosoft address)" Cc: sergei@posteo.net, Jiewen Yao , "Wang, Jian J" , "Lu, XiaoyuX" , "Jiang, Guomin" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please merge this fix asap. Our CI is broken because of it, and we are in the soft freeze so we need the CI up and running to catch potential issues before the release. Thanks, Ard. On Tue, 18 May 2021 at 02:59, 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.. > > 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? > > 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.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 > > > > Hello Jiewen, > > > > I get the error only for GCC49 and not for GCC5 toolchain. CI uses GC= C5. > > > > So I compared build commands and this seems to depend on LTO. Adding > > `-flto` > > impedes compiler's ability to detect such simple issues. > > > > I've found relevant bug report, there is even fix suggestion from last > 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 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 > >