From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.5587.1621324881645642104 for ; Tue, 18 May 2021 01:01:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=lhAs1uUC; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: hao.a.wu@intel.com) IronPort-SDR: ZebqmE+vwenA++LDL7JwNTXNWzPh2XsKWHZ5dRV8I68PC4gRZ+rOHMCM/U8qMk6QH6tsUOHx0u qxfI10el99Vw== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="198702811" X-IronPort-AV: E=Sophos;i="5.82,309,1613462400"; d="scan'208";a="198702811" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 01:01:19 -0700 IronPort-SDR: kI+02E+sM3WhO70rb76AO4A92dHGqCesK38FYdAXolRlP11B3Xq1Q3CNLnjsBHrSeN/97DLzB0 0sLeeEyAM6OQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,309,1613462400"; d="scan'208";a="393851029" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga003.jf.intel.com with ESMTP; 18 May 2021 01:01:18 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 18 May 2021 01:01:17 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 18 May 2021 01:01:17 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 18 May 2021 01:01:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=St+f3uVy6XBGunbBjJjVcbSsa8JJXZjIVlhO+fTPhBNyj1nnkynrzSewTXU5Z3bPjAb524ao+LLgVGT8NJvQcmP3bxRqToeLP9Umpw3zmfAHJCQy/DWYXHGug3jpELfXz/n/7snAObXwRGYzblXSECxS+0Ki+YcaUXV0n/QyLICfgEzcA+ccsqBfJGZqCelTXQLUVoSpGdR74yIjan+liC6BGd5SRxRVUfdX4ZDgQwlesnMDzf5ZyBnIC/a8moZ6li49R2W62i8sxykSWd8lP3wsDdpV3WuusemfZp4F151xTNwTe3+A/fotSSah5QcwDPTX9A7d4UZGAMc5TwYfEA== 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=gTeCIY5jwaksheXbmnzod6EqnyXZvRG3veJ7165Yk4M=; b=krXYErifnvLJ8xqJrOtU1cpiQKcxNOz+7KSi7l7DUOqIEL6dKKEw3f+ETzG2CA3opqb3r9O0Uf9V4+G0GPF0O1Q6S8ReDwfXsNS8B0yPn4CtygqL/yV+DbrqMGBfW2KS/Oe7XegWjd1A3Eu3enRQ0KQ5deZ1IVa78u9qO+dVNI0t6dY2b/rq16bDVlu2Kw6pWSAr6bcCqe1sKQ+1P4r49jCSAkUIsIb21TxAu4K8Z1HwdnLgLDkvU7cUYllQU/+D02fAVxhD/DG/T0szsDHO/PapKIflE1wWuRyDXIGKO5PCXNBDYpquT/cotospFVvMMwVSXvBwUR8C42dEAxxJrQ== 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=gTeCIY5jwaksheXbmnzod6EqnyXZvRG3veJ7165Yk4M=; b=lhAs1uUC3IRdZ9HI5Dk2cVeb4aSBUKol2Upj3UUJTZcdLF+tiJfyOVU2DMnbjtt2R9V2qN9FNhyhI0cfbjhPE3E+5UchC9xlDx+W3JiGHaOMIK+FObyQC2mL8OTTm1BsUNIOGyssCZNEsITMbTD0OR1OId3OUJ8J/tJPhVUH4pQ= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB4049.namprd11.prod.outlook.com (2603:10b6:405:7f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.28; Tue, 18 May 2021 08:01:16 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::b9d0:5694:1b70:c031]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::b9d0:5694:1b70:c031%4]) with mapi id 15.20.4129.031; Tue, 18 May 2021 08:01:16 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "sergei@posteo.net" , "Ni, Ray" CC: "Wang, Jian J" Subject: Re: [edk2-devel] [PATCH v1 2/3] MdeModulePkg/PciBusDxe: Fix possible uninitialized use Thread-Topic: [edk2-devel] [PATCH v1 2/3] MdeModulePkg/PciBusDxe: Fix possible uninitialized use Thread-Index: AQHXSsEjkE5EC5idWkmF9qdRf2U7e6rn3C6AgAEFuOA= Date: Tue, 18 May 2021 08:01:15 +0000 Message-ID: References: <20210514121714.17312-1-sergei@posteo.net> <20210514121714.17312-3-sergei@posteo.net> <20210517162235.GA21151@zx-spectrum> In-Reply-To: <20210517162235.GA21151@zx-spectrum> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e5a8c333-cc2a-49d3-5439-08d919d31cc9 x-ms-traffictypediagnostic: BN6PR11MB4049: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bGSFx7Q4KJMvP16d1GwsnKbLlY3EyHcPdgDLQkT/3Q5XLpiDscP183Vwcb0F6qfAlFPPI8VZ6PJ2tFzpnIyQzJRGDKV0a+cNHvoT1efyZSPUESFtsxeyKIa8Htgbd0HQeSJkCA3btZ3a5POCgVPuNcxciE7xqAWStldBhA3AmsHE0jgMO3v47POyX3Uo4ldaEbW9HnUaXbZaGWkgVfGCN9AZbjd2YbvrbZ2WcA8DKd8P4xNBRYpn0EvLG58Xsbt55UVj2wxcCoixPe8XtcMF8MHSktpme1NNSo+chKX6+7kMJG6W2fAnsVXkkSLVWdqsuMx/ScAOo+Jr/bbOn+XRn2QESh6Ru/pAIv4GK1O4B5OmgsxQH5XnO/QfLybtPK8AJedfCZWe2grWD7Vmml2cERuEKUxUwuO2dQhBuSdslchLkb2v+Gj8DAjegja/JD0G9XWF/5seYJ1oknO9Nv59HYlBhw1g8YKtXkTrfIVk1cj8c/F+ghv50Us6kYyta0TU/To6HYr9eJg9PLB3LYIFC6B7wdXjTjfW9Ycr0DpgLzSLdIDkWV2lOf3h7JF0d3raHYbzxYkF3WcsYn9v/YnFLUIj/1N2FmnBEecyQ9+QaH6140/TDhtup8Pagwn9xYBvUCGeXi6E18UYMfB8DnJULZNKZjumNlxFMMYxF7TuJoM8vu80J+Q5R4pa8SbsuWKM2WZEd4JDP6mOzBtMBpO8Ue4bU2fd5vMOLHBwHlpYt+Y= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(366004)(376002)(136003)(39860400002)(396003)(33656002)(2906002)(8936002)(52536014)(66946007)(5660300002)(66446008)(83380400001)(966005)(6636002)(26005)(4326008)(66476007)(478600001)(6506007)(7696005)(186003)(110136005)(64756008)(8676002)(76116006)(53546011)(55016002)(122000001)(107886003)(316002)(71200400001)(66556008)(9686003)(38100700002)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?JToO9JFg/fYYu/80aYAqC9lUFVCy3VhevrXXBs0Nr9vqpdZynWk0ud+acVjT?= =?us-ascii?Q?9o9QUf8KTjIjShNgcTocyzxM0MYNkfCXH8a/krOJBKGgA9he/RaermPDQ2fB?= =?us-ascii?Q?ijIov6EPGzo71eYdniFyVDi8JeFW+7hNqIdYafKQyhFPqpDcTiYt2lQv4+79?= =?us-ascii?Q?EOKB/+hBDtSjJhRlzC9P6efYJnDmGWbATfWZDBO3wVnAoM/Zy0RKkoSpOfpL?= =?us-ascii?Q?gZjxKf4NJITR9GHs6MAu6APvJfzyQ7e/5xv7YatH7xs18Y/NwBbPYOe5UkVw?= =?us-ascii?Q?dmWCGPFekmNUlQE6711AK00ups5U7mS79K+XJoQda/zw7JloCb5ckooyYB7n?= =?us-ascii?Q?bZypGYA25+DlqQK4fTK14HT8wFsWC4hJWkQiLH1DEmybvHhoCKKJIgA+9Hg3?= =?us-ascii?Q?vDdSnWjxwU1wUJTaVQKPVVzqHiW/FK+EOhlpePxTAPonIJTy17SCQ9GPJHut?= =?us-ascii?Q?x4lxTGWcakyWBArePFpk/ZgovQumNtLgOkYFpE/3YK8OEb11L+wdUWIzS9YW?= =?us-ascii?Q?xYv1t6VvCjyc2a3i4j4v3uCWbPsyg25CE7qgd9KKLEkZCE3XZ/Rm7ejcnvEh?= =?us-ascii?Q?AgUHWhMXXS91e8/oCChMGjEZIp75qpXbD9NaXDUOZJGBnLQV+hhbYPeDQo/U?= =?us-ascii?Q?5AfKBS1zT2ytwzhruyIhm+V3gVFlRQocnNNEmBTPXZ46TKm1E9pJlzyBQghh?= =?us-ascii?Q?8vB4C8FV5WMZGpBly7WxIoFZ53gO8jvnXIZ/D2si7fQ3HmsnWWHO8H3xonep?= =?us-ascii?Q?Xt7Y2zMPEmQVtuLwALzhQgDpHoInQvQGJbw0fWC+fvrBwQjdRMLHw0OU0OJW?= =?us-ascii?Q?hUNz/V4Y9EXr5WgoKgCb9nd4QnmhTx6P7bK708lzNEApRUOcVb3tx4b2/vG6?= =?us-ascii?Q?oUX5o1sSXuLDqVXIYtvFYmnU+OL7GvgAIsf2OmOcJ8pX6rD+n6JkS3POHEwk?= =?us-ascii?Q?ALp6KP2P6yvMgt0pp52+FnqJvcOWCODmO4Hj+0vmIkEvSRFnNl/x2+okiXAd?= =?us-ascii?Q?yLEvrvDuNvpQYk/WEOG1TUusvloWWrEFQttNtPt1fIFCpwbvYGn77CZICLvE?= =?us-ascii?Q?yUfZHZuDF7beg5xD3XWg4YoyOs3IG062LXu6KtkMkeVCsnM5CRwH9xgJId+s?= =?us-ascii?Q?3QHkfQJj7oueEV/ZNbk86ck0a6m9G6Thj6hg5M7tZHxEglC5fkKVzlR77BaV?= =?us-ascii?Q?1cJr+alGe8GghaiGH3d3JEjR+TMGAiVdQbFLisx4HLoeNspKLkmoLqZs1LG/?= =?us-ascii?Q?TAMsBmpWcuzO8/3Q2/R+0zasSWPo47NaAnbHlFQEoise1/NFp2e76S06Vv13?= =?us-ascii?Q?jo1+IlOYdFiSa1H7sZPbCvw/?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5a8c333-cc2a-49d3-5439-08d919d31cc9 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2021 08:01:16.0096 (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: rkONK7XEE0r5MpuKh4vsJgm2Dra4liCOyuk5Mx6FXUJS/Kj5IiVCp3AqmAsI/KfgtBB2h3TrAE6MiLW5pSI7kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4049 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sergei > Dmitrouk > Sent: Tuesday, May 18, 2021 12:23 AM > To: devel@edk2.groups.io; Ni, Ray > Cc: Wang, Jian J ; Wu, Hao A > Subject: Re: [edk2-devel] [PATCH v1 2/3] MdeModulePkg/PciBusDxe: Fix > possible uninitialized use >=20 > If the function gets invalid value for the `ResizableBarOp` parameter an= d > asserts are disabled, `Bit` can be used uninitialized. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Sergei Dmitrouk > --- >=20 > Notes: > v2: > - simplify if-statement to avoid unused branches Hello, Since the V1 is a patch series, I would suggest to send the whole series f= or V2 changes (even if other patches are unchanged). With this handled: Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > index 6bba28367165..4caac56f1dcd 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > @@ -1778,10 +1778,9 @@ PciProgramResizableBar ( >=20 > if (ResizableBarOp =3D=3D PciResizableBarMax) { > Bit =3D HighBitSet64(Capabilities); > - } else if (ResizableBarOp =3D=3D PciResizableBarMin) { > + } else { > + ASSERT (ResizableBarOp =3D=3D PciResizableBarMin); > Bit =3D LowBitSet64(Capabilities); > - } else { > - ASSERT ((ResizableBarOp =3D=3D PciResizableBarMax) || (ResizableB= arOp =3D=3D > PciResizableBarMin)); > } >=20 > ASSERT (Bit >=3D 0); > -- > 2.17.6 >=20 >=20 >=20 >=20 >=20