From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web09.970.1621038651065904769 for ; Fri, 14 May 2021 17:30:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=PUEUmMSw; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: jiewen.yao@intel.com) IronPort-SDR: 0EemHlYVKzYFYpbDE2APiYthrxtxRGcNvlL1DWHK+u0zt7srETvYjbJUBhPsIOAj9iJNV1aFwr Nc3EU6EBnjGw== X-IronPort-AV: E=McAfee;i="6200,9189,9984"; a="264177372" X-IronPort-AV: E=Sophos;i="5.82,300,1613462400"; d="scan'208";a="264177372" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2021 17:30:47 -0700 IronPort-SDR: 4KGmHBVIKNPE09WUaAYVuCoNYvqF5EI8QbB4ReGB0WzwY4FuRA+MVtWOkAzEEJGF6mFJ62qk3T 7S2ayQ7D8FBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,300,1613462400"; d="scan'208";a="624984410" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga006.fm.intel.com with ESMTP; 14 May 2021 17:30:47 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 14 May 2021 17:30:46 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 14 May 2021 17:30:46 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Fri, 14 May 2021 17:30:46 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Fri, 14 May 2021 17:30:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BVBEAYkXXGtXiCuCfPGEWkU3TKwjCfK/X0Ej1X+osDfaaUiXJPSZIU2CbQGv+CCUJxDtC/HJZMtH3OBEFwhL6QOmGZEAVhXJea+nzyb0r6cXqRShwSH1wpvwrJWFy2G/8QcHxGiSU6w3zqlSXBRWNYfdUvz+dpG7Y5XVtMNYiKbzzwcEXtt8E963yWgsKHwCM8Wy3coxR/jnUEpkTZqnFLHD67Qb0p64nTlLzFg9XbPbG28MWrGOSvbyM1udw+6ACseMhyUl9BsLgvD0OkLyy2vtWz9yFB2bq60WYshnP9ajUcxdCU89iQXtjLga5aNbEuNCgcREmxFdTBKNohtP2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yqtsqTPr8xMZmA9HwC/cqYi14MHpVhG9AqMb2eJTi40=; b=jYrTTYxfY9p6tNrqC/+UNBYsYkkWrN3ThV1S2FncUyRLSwOkLSrW/EN88hI4yU+0ZITi3zHe9YVyU60x/hjva1UZ7hYvUXQAEphi2B/+oyYcBIuIBU8Q+4FErKtSmAN3B6eBVFos9HJm79mSreO/dWbj10CPHxh87P4HaswxSy1pX17habPnlZcu4faBYfa2eqH7kXXb+jGNdxaIRvsjdi3K56R/VyY8V6ZeNdKMuOCD/6OmO0NaANQLNsTM3b39IKS9WDVYBci7K6HObWK1/2bE5+aXI4POgnSnGR4HZeBg76dWKtFNyF+W38FQS13uvYplcLlp2wEN03+d3jSfNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yqtsqTPr8xMZmA9HwC/cqYi14MHpVhG9AqMb2eJTi40=; b=PUEUmMSw2HXtFiCfL/6NxJ/wNTj+ov4xGqw8/yBsYM7KZCWUs8Ji5wOxGOYkObpRTE9veIYe01qHNesmXxgxqMpHjj6nQZyhMK3UXCVo+6J82chH4CU0M2x+HaKWWbTZgP41XBPmvCyLOpPmpaXjeR3rJ24atLC0mQUzZ141ypY= Received: from PH0PR11MB4885.namprd11.prod.outlook.com (2603:10b6:510:35::14) by PH0PR11MB4919.namprd11.prod.outlook.com (2603:10b6:510:34::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Sat, 15 May 2021 00:30:44 +0000 Received: from PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::4cf8:ac8:a6fd:d386]) by PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::4cf8:ac8:a6fd:d386%7]) with mapi id 15.20.4129.028; Sat, 15 May 2021 00:30:44 +0000 From: "Yao, Jiewen" To: Sergei Dmitrouk , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Lu, XiaoyuX" , "Jiang, Guomin" Subject: Re: [PATCH v1 3/3] CryptoPkg/BaseCryptLib: Fix possible uninitialized use Thread-Topic: [PATCH v1 3/3] CryptoPkg/BaseCryptLib: Fix possible uninitialized use Thread-Index: AQHXSLso8qEWiWuXwkaxu8ytip135Krjr8Jg Date: Sat, 15 May 2021 00:30:44 +0000 Message-ID: References: <20210514121714.17312-1-sergei@posteo.net> <20210514121714.17312-4-sergei@posteo.net> In-Reply-To: <20210514121714.17312-4-sergei@posteo.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: posteo.net; dkim=none (message not signed) header.d=none;posteo.net; dmarc=none action=none header.from=intel.com; x-originating-ip: [101.87.139.49] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7e3d009c-14d6-438c-14c2-08d91738adb1 x-ms-traffictypediagnostic: PH0PR11MB4919: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LStqte7wbRnLuJs1dtlewbmmx5fQ+5opBNA5yOJwfqZpdtMIftHKnogsZhZCee40PlqY5L0Kir0C1lH4fEXd4pdAibSZvCyO7otv7wOkxuxivZRkzZFEF9JnrdKTV6z5rWsCB2CQU3vAK8bibyrKR2/14OVM0cJml3fhH72BuG2mY23qucN3iA2IiVZWnHkww/pzh2pOSIQhiuTUYtiypWoMv7zyfnbPsvB5KmdSxaddM5sKYOM7f57r5JuVDUWKRXRvZ+jjDJCa+mSRN0NhzytVsDsBv0nIa+ESgzl4G8A3yewzLwD/oRMUKPwAqhS02+7QJkba1P0UolJuAyexuiAl5HS7GBGt5wdjLnXu1P7BBhKn7kkt/SqlXS0xjCL2LGq1XiOPaTng62ZXwu3B7km/1N/9wQKavgBx5e972ywlV7PTcZo/UAFY0WZM1e7lUjC5oX+LQD+unfS3KVtZVS0GxSq3XovhhDQN31xkIYR3syUVSEpzhzQQ/siFBnRfCO0H1XtDD+IDJ3DsSR4WgGCJGduKkYAbyVc4CC70s/l9VzXgsUZ5dIQzA0vL4WQxkEeWqjr9jIPuNNIHGIKjLiyfnuDAOIezOieZJSUG2/M= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4885.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(136003)(396003)(346002)(376002)(39860400002)(6506007)(53546011)(316002)(186003)(33656002)(71200400001)(8676002)(7696005)(26005)(55016002)(52536014)(9686003)(107886003)(66446008)(5660300002)(478600001)(38100700002)(66476007)(54906003)(122000001)(76116006)(4326008)(110136005)(64756008)(83380400001)(66946007)(66556008)(2906002)(8936002)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?3OdrzJ2YDuekBnqpH1zlhoLJ1+luz3MKKIfm9uXmuOzx7NDgLGPdrctvLaiz?= =?us-ascii?Q?mA2IUW0NT8daXZHX+RGVts5F32hEbdxn39NuMR2mWBQTt58LX/zBoLLgtwvp?= =?us-ascii?Q?A5rKotVeWIG0suSApkfCGw8kDz2szPmx8505+2772qCuhk5HqbLAfKOw9VnF?= =?us-ascii?Q?sqc6WxMCeuKidUAcueOt/6bM5xyiuTqHZ/L5ckKRQwWDAH88RHiTDdS7m04X?= =?us-ascii?Q?TDwaSccC0ZJEQTKuzPZTyM9egJfouD7zoR1MPSYjVp/fM/sqanLdSzLlC8wg?= =?us-ascii?Q?JNaUJuG1+mqH2on7oz8HnsC1EXsSuP/JIKMYvc/3pWmw4+cIjj+Uz9jBhIJU?= =?us-ascii?Q?b85So/QUF5z6gKHr8cSo7YLAHqIO3gIr56/1fJU2AFgOW6+gIfFE1knlDRlA?= =?us-ascii?Q?loELB3DfUFm7W2k4p4go8E/F/gQaomH4Zvy52Rd1YtM+KXYMEAiJ7HrP0T/Z?= =?us-ascii?Q?LlQhpVPgM0yuAoy0pMJURt6jHG2gyd9EKc3+4o3cD6OWY83cJ/sv+d1F37mo?= =?us-ascii?Q?w/XNAE+g+bDIUD+p8VzRA/PMwfATdDx9b8F7+RjFBheusbzlZvqG1B0+47zu?= =?us-ascii?Q?zfG12Zvi+hT65SeWJpBlVA6rPpiDgg6K+5NFP2zdgSoFseBq2AlEAfxtBsog?= =?us-ascii?Q?V/ZeIb3aokdqMQm0crwGYAvZLjxBM1apbZ6xf5syaPxXe4bvey3tAxIb8yKF?= =?us-ascii?Q?jM1HlVRe8NPS2mMmlwJJhUJAawhKf2LoONM9QqHmN4IzG0SrWBQXT/GHZWXt?= =?us-ascii?Q?W3x1BpJ5X4R7SgEjWDH3aOpzSOCtUACvjtEUDKtbnWWGOxIoblQz0mANRyjP?= =?us-ascii?Q?jK9OXIfjAUsqQZlQMYwp/Zatdp0ocrwzbtF+/AXgZUtKiY5jcJBx4dOyK6AG?= =?us-ascii?Q?4D7PrwX24jQILjhhyQH/ECNNkdGdSETLMENGVIfiDBQqJ5BBXg8KNxp1cSsl?= =?us-ascii?Q?WeGa2uWoGT6JeGYCeKZIDYv1+hv+GUIAlCXWMEziJDlWmjuGvf+rBekBQVns?= =?us-ascii?Q?zQBOQ1rhjkxSJb5nZ/UyDiEQi2PGlvPHjoDh9XsaWtCRMqgJfzq7vMvnT4w0?= =?us-ascii?Q?6riSy6abUbz8TWZ8+rhupQkuC3QPybvi9GTs5ShdqOnVF34auGU49ev2HD/F?= =?us-ascii?Q?gSQi21IA7qDa8aYWDwei+JrClAdV5W2vkC3Tm3/rEMg+5i0QFTcndoDsozBx?= =?us-ascii?Q?YTK/5Ty2CwSk2ypRcmhSj8R7ptvA7I7POunAqZa8VGnhmKbku1fN6m7ExEZ0?= =?us-ascii?Q?XHYn/k8vYBr2paak24iZfs1SUoK6sPnxBJEZ+8s2YSlIf2KKG8sm+YtJmfUA?= =?us-ascii?Q?8+tDsRRKzfxnYigWlqIP18MF?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4885.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e3d009c-14d6-438c-14c2-08d91738adb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2021 00:30:44.8370 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hdwRc4j4FbbiKaRd7uKHKTAqTefSNQ7Zh+DzSjLApfd6uiZEXDYjAfdqdX8L+Y5piYfLho44YtXmkUaqbllUjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4919 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 t= he 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 uninitialize= d use >=20 > `Result` can be used uninitialized in both functions after following > either first or second `goto` statement. >=20 > 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(+) >=20 > 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; >=20 > + 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; >=20 > + Result =3D FALSE; > EvpRsaKey =3D NULL; > EvpVerifyCtx =3D NULL; > KeyCtx =3D NULL; > -- > 2.17.6