From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.9142.1634011991206947197 for ; Mon, 11 Oct 2021 21:13:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ElUc5SFC; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: dandan.bi@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="207153232" X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="207153232" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 21:13:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="658914166" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 11 Oct 2021 21:13:09 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.12; Mon, 11 Oct 2021 21:13:09 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 11 Oct 2021 21:13:09 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 11 Oct 2021 21:13:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=li+a79ewUzvuGAR+9c8kXgKa4Ku3lLETqleGk1DJ4LZbuWooKTkxfOmiDH45VvboxNXS1yoYy9dcBfcNs5q62VKZvEMInopAPs9rtfzJrcnIm956HaNLNDUnPf/VPZdmJ2El8r+zP3XbsO3OHUesu1zl4xDSK7l637AJd82K1Nz8vP+34KzxJJYlLY6+OtcrbyVE9WYS+P/FjzafUirHXf52tFM3/DGNOT4MzrrfikK0AMKJFyNbo+RzcQCm0Ds341ZaDCOVF2bPXiAX0wfDpHS15OsMKPo/LTY0tqAJ9Hkc6ZLDw4qemRoTdvehq1zWA3KuLELlqTEVyCB85qaBPA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dUZT5uUX73xHI5yGlBXZzGyi7+Z16oF8U3egeSMW/vE=; b=iqi6G4dUCi1PDPoLWP6/qfB6bjKmgipJq0oBFV8oym9ufVavsXp33Wrd2aZB28CbymWHJw+ZXN2/FQJTvOiHyTH6sb3d42ynSpsbC5usJC1NoAi465Bhs3XAoGqqcYYdgbfB+LQFxz7xVGRbnXosCkAZZzoL1tKT/1s7OkVgzAF0Ksk04rd6OmuZapZ3WmPjQLckeprGrSGJF89GLuu5QalFsP125/oHOqR8qMdGQTgV6mjqe6XobV8qff6g00GLRd70VkL8Z0g1TIGoDHqsx19ELYr2gq3PquQMBdKp7meMcqipkr7vwc7+MCx5aSXZvrLWAZPUPfouGyq1cLCM9g== 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=dUZT5uUX73xHI5yGlBXZzGyi7+Z16oF8U3egeSMW/vE=; b=ElUc5SFCSIih/VmDwsA6whZO2RQIRV+tDAN0fpTpAIvSLgef7IvkLZCIolTV4Zc8HPlkXfzmOvFoVLn8Ia4HPAXnLC7FLcy1xr0Z1alLfZ67iV+d940nhWACUyN8izvW/NqESZ44j0wjQgz8WR+iA1ECo4P2m3B4h0vG0tbUFws= Received: from DM4PR11MB5453.namprd11.prod.outlook.com (2603:10b6:5:398::15) by DM6PR11MB4443.namprd11.prod.outlook.com (2603:10b6:5:14d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Tue, 12 Oct 2021 04:13:07 +0000 Received: from DM4PR11MB5453.namprd11.prod.outlook.com ([fe80::ed4c:25e0:281e:da52]) by DM4PR11MB5453.namprd11.prod.outlook.com ([fe80::ed4c:25e0:281e:da52%2]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 04:13:07 +0000 From: "Dandan Bi" To: "Ma, Hua" , "devel@edk2.groups.io" CC: "Wang, Jian J" , Liming Gao , "Ni, Ray" Subject: Re: [PATCH] MdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleList Thread-Topic: [PATCH] MdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleList Thread-Index: AQHXvo0r9uU2WUEx1kOgxQCglLxhMqvOvc5w Date: Tue, 12 Oct 2021 04:13:07 +0000 Message-ID: References: <7c0683f0a02729d8c75dcb631fec2941c834629e.1633948972.git.hua.ma@intel.com> In-Reply-To: <7c0683f0a02729d8c75dcb631fec2941c834629e.1633948972.git.hua.ma@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3e92ab1a-23a2-4fc9-e640-08d98d369865 x-ms-traffictypediagnostic: DM6PR11MB4443: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IQP5xvVraPPEPxWXgKmeZ2tii2o5dqw3Z/0TQU89041HeIX8H2yPxw3TRtZjEEKiDWFy3Gnja3PEXCLUF8YF3IoQXMt9pG0fwyHRsoNEuD6TZqUbDLUIum8daQOFdYAUqvardTdN/y6drNpLfBS9thu1dHGojZTVj2pVCfTxiQWY3jBk+eCYOG5rwdIVfftIMiy+ZNlBy0n5Tyi75FzfTaThvvRKEMz7jWEd+rO5ExsKhORtKDR4DMJIA1wYU+Z4dyYQp6oGnaMUz6dAGWvdw3l41p36WsBoyhvmCUjMDxgABjke5LJRaGjMeym5uksDPxaqds14ZkVvreEgA4HhmK9DXc81ItGUf0G63FqwIaJ2NTHRC/VsQTab8CYbYMqWMq29WrIYYcBrOjzZNlcoQJVvGzT6/djfusTlQ/0VwrZ1NoD64oNM+NzKaVmRWFoQ4UkxW4u6nWQcOR46h99DvOMP/jWvdRQa7oN3XVQ1EAvfNnHWRzP6uLshuOuc+IITxdF3F5HnkgOgOA57t0PMluVGDPUa/J2oxH8llgwZOAYqsj+KCJhAIKRILzA2XqIihdk4sH8qEtDU/qxPle4DAmonhAyPRVKKitTbuY4PM7Xid2AsIg3NeP12vfdCCqqxKbLiv2HTjoMfZJEIyUsxFvZlrcztuvJEKwR4dF10D+pGIoGPE9y/9qkDiC9tEK5ePDF2JEfofk41/gOkyTh57lFhvO2aVRBQOvwPo9lbLQfoJBW4FFEfLU/pl1qoxwZivkmfb10Tzs0tseByHVZ/xCttSBuRP5vxT61iOOLopz8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5453.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(66446008)(64756008)(66556008)(66476007)(83380400001)(86362001)(66946007)(76116006)(966005)(38070700005)(33656002)(53546011)(6506007)(107886003)(4326008)(9686003)(55016002)(508600001)(186003)(8676002)(8936002)(5660300002)(52536014)(71200400001)(2906002)(7696005)(54906003)(26005)(316002)(110136005)(122000001)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nhNaWZzuF1C9oU0P7jWv3Frcq5ZDdnL+V59Hz4dBwCydhoBOYJjnoUe6kCwd?= =?us-ascii?Q?VZHO/tV/KLdS1IlVzskALywk5stpuF60K+/HJ1FdUgIfoookGtAsv2veQV3q?= =?us-ascii?Q?5rDA9fhWyKasO+41VsgvcBH9ZbgX2GoKcrLNQ0R9Jk860mkPkrR656v19NAv?= =?us-ascii?Q?1Mdn1N+Vkk2+8sqy6A/dszF9w2cw4NjyyfyuVTmeeMpIM24SfH7wpXCnhQGt?= =?us-ascii?Q?nYYM56MqxfV0/OdLB3fq3GDJxIyTlRkUpCUnRIiKkSwyDCu4pvd60hIs8nov?= =?us-ascii?Q?CooQKc0+qzyHbx4HMWxKcO8gOgS+3aG6GzKnIw7R0fJl67mT7KH9RQD423B0?= =?us-ascii?Q?cp66nsKB4+WQF74pUMLHPh+bC+EITUZqwzlJfN9KWImIYIC2mbgAKqxCtJ4t?= =?us-ascii?Q?pq/bQdLgdoM1hCiSrORfISOfnu99uC/kNkxeXfo/HVNDT9h9uizHA44m64hJ?= =?us-ascii?Q?KrxB7I2GnC/NRqwt3Ws5BeMv700Bt1ELCcZAt9kjlAI6EFywP3BUJuWVr6xW?= =?us-ascii?Q?81sB1ybCHCQUkyFyasXV31AkqQt2NTVHi7+UmSSALGbVITJgqJct8izRuIWD?= =?us-ascii?Q?UkD0DfPHjOSlHOHDV0tq9qHHb2u3+rilx3BBJIIWeKNrqkPQ7hELKLpi29R5?= =?us-ascii?Q?CeP3ok+0hbil+qTcVRFUQMvNVzQiTCwjv2kurxpj55wZW32t21z25832FVea?= =?us-ascii?Q?abhilHHEs+UN19bokoh71CdJkUfq79Tki+lh8dxlmdcfEBAR7Iq8C8tkRlhc?= =?us-ascii?Q?qCGMEYeOPBpkUfsZwENkU5izpHWE9H3d5sjnumPXAo6jXq+KJSkfFTnEt2FC?= =?us-ascii?Q?sp3j6f+gcLbMXTyS/M5UjKFW5JK4IDL5Q4q7aAbTp4x0oSOges+QnmxdJVAs?= =?us-ascii?Q?g4CV/lkIDzzs5STGuL/ijMio2HldHgU3je3XEn351ZKrTb+LAGtm5LKPcqrn?= =?us-ascii?Q?/K82QpzrPOfJl2vLwewPJdmnqzomoMWHq+EH3tAf1PlJX37riE2j5PGolvKt?= =?us-ascii?Q?uxwz76QMJwsTCte1u3JgJWVWKkPmVFkqF6yqR33vWsoQ6XlrLeEg7Tjq1r+4?= =?us-ascii?Q?9qVomwmv3Z5Imsvre5mylmFsvbXT/fC3w5wjNAu55xESyugf3LJPaAqOzvC8?= =?us-ascii?Q?Sc1IVf0ot66OogKyUfOZ0ZlN87mhCwr7MB75DqaR0pvI0JK8dCD6hJcBFuqG?= =?us-ascii?Q?v/7qOV/sA/2yrYfJlwOTAHQetkBh6sSO9+FS1U1AYdeIscoAFVtHBSNBXr/P?= =?us-ascii?Q?LUOxM+GSmG/jbOUVkmZJX64CtVk9Tr8jS3T4YuGYPIsBdPbZ7xGUIKsPfHpa?= =?us-ascii?Q?+k1ayvF6gGNqamlNjuBRGxxC?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5453.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e92ab1a-23a2-4fc9-e640-08d98d369865 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 04:13:07.2986 (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: UFA1szGnT6CMbhb6miZRoWW8NFyscBu/6V0G4qmnS8Zloq4bVwPoUro0LGuV7i2E1ozqz+VQ7RKbvXLaDae3fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4443 Return-Path: dandan.bi@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Hua, One minor comment inline, please check. Thanks, Dandan > -----Original Message----- > From: Ma, Hua > Sent: Monday, October 11, 2021 6:45 PM > To: devel@edk2.groups.io > Cc: Ma, Hua ; Wang, Jian J ; > Liming Gao ; Bi, Dandan ; > Ni, Ray > Subject: [PATCH] MdeModulePkg/Core/Dxe: Acquire a lock when iterating > gHandleList >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3680 >=20 > This patch fixes the following issue: >=20 > The global variable gHandleList is a linked list. > This list is locked when a entry is added or removed from the list, but t= here is no > lock when iterating this list in function CoreValidateHandle(). > It can lead to "Handle.c (76): CR has Bad Signature" assertion if the ite= rated > entry in the list is just removed by other task during iterating. > Locking the list when iterating can fix this issue. >=20 > Cc: Jian J Wang > Cc: Liming Gao > Cc: Dandan Bi > Cc: Ray Ni > Signed-off-by: Hua Ma > --- > MdeModulePkg/Core/Dxe/Hand/DriverSupport.c | 10 ++--- > MdeModulePkg/Core/Dxe/Hand/Handle.c | 47 ++++++++++++++-------- > MdeModulePkg/Core/Dxe/Hand/Handle.h | 3 +- > MdeModulePkg/Core/Dxe/Hand/Notify.c | 2 +- > 4 files changed, 39 insertions(+), 23 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c > b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c > index feabf12faf..eb8a765d2c 100644 > --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c > +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c > @@ -68,7 +68,7 @@ CoreConnectController ( > // > // Make sure ControllerHandle is valid > // > - Status =3D CoreValidateHandle (ControllerHandle); > + Status =3D CoreValidateHandle (ControllerHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -154,7 +154,7 @@ CoreConnectController ( > // > // Make sure the DriverBindingHandle is valid > // > - Status =3D CoreValidateHandle (ControllerHandle); > + Status =3D CoreValidateHandle (ControllerHandle, TRUE); > if (EFI_ERROR (Status)) { > // > // Release the protocol lock on the handle database @@ -268,7 +268= ,7 @@ > AddSortedDriverBindingProtocol ( > // > // Make sure the DriverBindingHandle is valid > // > - Status =3D CoreValidateHandle (DriverBindingHandle); > + Status =3D CoreValidateHandle (DriverBindingHandle, FALSE); > if (EFI_ERROR (Status)) { > return; > } > @@ -746,7 +746,7 @@ CoreDisconnectController ( > // > // Make sure ControllerHandle is valid > // > - Status =3D CoreValidateHandle (ControllerHandle); > + Status =3D CoreValidateHandle (ControllerHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -755,7 +755,7 @@ CoreDisconnectController ( > // Make sure ChildHandle is valid if it is not NULL > // > if (ChildHandle !=3D NULL) { > - Status =3D CoreValidateHandle (ChildHandle); > + Status =3D CoreValidateHandle (ChildHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c > b/MdeModulePkg/Core/Dxe/Hand/Handle.c > index 6eccb41ecb..b4f389bb35 100644 > --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c > +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c > @@ -55,31 +55,46 @@ CoreReleaseProtocolLock ( > Check whether a handle is a valid EFI_HANDLE >=20 > @param UserHandle The handle to check > + @param IsLocked The protocol lock is acquried or not >=20 > @retval EFI_INVALID_PARAMETER The handle is NULL or not a valid > EFI_HANDLE. > + @retval EFI_NOT_FOUND The handle is not found in the handle > database. > @retval EFI_SUCCESS The handle is valid EFI_HANDLE. >=20 > **/ > EFI_STATUS > CoreValidateHandle ( > - IN EFI_HANDLE UserHandle > + IN EFI_HANDLE UserHandle, > + IN BOOLEAN IsLocked > ) > { > IHANDLE *Handle; > LIST_ENTRY *Link; > + EFI_STATUS Status; >=20 > if (UserHandle =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } >=20 > + if (IsLocked) { > + ASSERT_LOCKED(&gProtocolDatabaseLock); > + } else { > + CoreAcquireProtocolLock (); > + } > + > + Status =3D EFI_NOT_FOUND; > for (Link =3D gHandleList.BackLink; Link !=3D &gHandleList; Link =3D L= ink->BackLink) { > Handle =3D CR (Link, IHANDLE, AllHandles, EFI_HANDLE_SIGNATURE); > if (Handle =3D=3D (IHANDLE *) UserHandle) { > - return EFI_SUCCESS; > + Status =3D EFI_SUCCESS; > + break; > } > } >=20 > - return EFI_INVALID_PARAMETER; > + if (!IsLocked) { > + CoreReleaseProtocolLock (); > + } > + return Status; > } >=20 >=20 > @@ -428,7 +443,7 @@ CoreInstallProtocolInterfaceNotify ( > // > InsertTailList (&gHandleList, &Handle->AllHandles); > } else { > - Status =3D CoreValidateHandle (Handle); > + Status =3D CoreValidateHandle (Handle, TRUE); > if (EFI_ERROR (Status)) { > DEBUG((DEBUG_ERROR, "InstallProtocolInterface: input handle at 0x%= x is > invalid\n", Handle)); > goto Done; > @@ -723,7 +738,7 @@ CoreUninstallProtocolInterface ( > // > // Check that UserHandle is a valid handle > // > - Status =3D CoreValidateHandle (UserHandle); > + Status =3D CoreValidateHandle (UserHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -899,7 +914,7 @@ CoreGetProtocolInterface ( > IHANDLE *Handle; > LIST_ENTRY *Link; >=20 > - Status =3D CoreValidateHandle (UserHandle); > + Status =3D CoreValidateHandle (UserHandle, TRUE); [Dandan] As current all callers of CoreGetProtocolInterface () has acquired= the lock, it's OK to pass TRUE to indicate the lock is acquired.=20 I am just thinking about following small question. Could we add some comments to explain why it's true here and also notify th= at caller should also acquire the lock firstly by itself if there is any ne= w caller added to call this function? > if (EFI_ERROR (Status)) { > return NULL; > } > @@ -1013,7 +1028,7 @@ CoreOpenProtocol ( > // > // Check for invalid UserHandle > // > - Status =3D CoreValidateHandle (UserHandle); > + Status =3D CoreValidateHandle (UserHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -1023,11 +1038,11 @@ CoreOpenProtocol ( > // > switch (Attributes) { > case EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER : > - Status =3D CoreValidateHandle (ImageHandle); > + Status =3D CoreValidateHandle (ImageHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > - Status =3D CoreValidateHandle (ControllerHandle); > + Status =3D CoreValidateHandle (ControllerHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -1037,17 +1052,17 @@ CoreOpenProtocol ( > break; > case EFI_OPEN_PROTOCOL_BY_DRIVER : > case EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE : > - Status =3D CoreValidateHandle (ImageHandle); > + Status =3D CoreValidateHandle (ImageHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > - Status =3D CoreValidateHandle (ControllerHandle); > + Status =3D CoreValidateHandle (ControllerHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > break; > case EFI_OPEN_PROTOCOL_EXCLUSIVE : > - Status =3D CoreValidateHandle (ImageHandle); > + Status =3D CoreValidateHandle (ImageHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -1249,16 +1264,16 @@ CoreCloseProtocol ( > // > // Check for invalid parameters > // > - Status =3D CoreValidateHandle (UserHandle); > + Status =3D CoreValidateHandle (UserHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > - Status =3D CoreValidateHandle (AgentHandle); > + Status =3D CoreValidateHandle (AgentHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > if (ControllerHandle !=3D NULL) { > - Status =3D CoreValidateHandle (ControllerHandle); > + Status =3D CoreValidateHandle (ControllerHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > @@ -1443,7 +1458,7 @@ CoreProtocolsPerHandle ( > UINTN ProtocolCount; > EFI_GUID **Buffer; >=20 > - Status =3D CoreValidateHandle (UserHandle); > + Status =3D CoreValidateHandle (UserHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.h > b/MdeModulePkg/Core/Dxe/Hand/Handle.h > index 83eb2b9f3a..b962d80a29 100644 > --- a/MdeModulePkg/Core/Dxe/Hand/Handle.h > +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.h > @@ -251,7 +251,8 @@ CoreReleaseProtocolLock ( **/ EFI_STATUS > CoreValidateHandle ( > - IN EFI_HANDLE UserHandle > + IN EFI_HANDLE UserHandle, > + IN BOOLEAN IsLocked > ); >=20 > // > diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c > b/MdeModulePkg/Core/Dxe/Hand/Notify.c > index 553413a350..f4e7c01e96 100644 > --- a/MdeModulePkg/Core/Dxe/Hand/Notify.c > +++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c > @@ -188,7 +188,7 @@ CoreReinstallProtocolInterface ( > PROTOCOL_INTERFACE *Prot; > PROTOCOL_ENTRY *ProtEntry; >=20 > - Status =3D CoreValidateHandle (UserHandle); > + Status =3D CoreValidateHandle (UserHandle, FALSE); > if (EFI_ERROR (Status)) { > return Status; > } > -- > 2.32.0.windows.2