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.10853.1634027847979167646 for ; Tue, 12 Oct 2021 01:37:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=A1+Hkoyw; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: hua.ma@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="290574944" X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="290574944" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 01:37:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="524143849" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 12 Oct 2021 01:37:27 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 01:37:26 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 01:37:26 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.12 via Frontend Transport; Tue, 12 Oct 2021 01:37:26 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.47) 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.2242.12; Tue, 12 Oct 2021 01:37:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oa3zVwWqH2iDwu/e5zAy7G90OBSaz55P8ZbzdsLE4VEkEsdyi/WLx33D6v999yR3RpXj8+c1E7Ol34btMuHJTu9g06HQg5Jms+1GQ07w+7+iwVqK8n6zDProoHGSsFOAw23ykjG5jut++alRPP66mnKj4j8WSBK/pql81XD62axFZPyd3RgkPUrWM1uJ7snUwDi1/74dceSqXbtsNCdiShyS8n+DrvAMjxJ4/a1ZVng2BF0tAGxOwQ3zdbXHMwQT7uSNRtsezGWL6gUJ6Suycqx3+/yHkNMRHVUfV1zu47xvAbHywJzzb6+YHOUUSmP+O7msgJw3sDdvYse0q30beQ== 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=7DLQ4NeiftFPJUUmf2KpLAQzH8CH14nB7VBGHvFC904=; b=dcrTt82tHeT4tg5RdBvR9SpOsPwmk+EyPX5OFyRA2YyqvBS4agh/5LKMMlWQB/PAvZsTfobRwXvP7kVaKWvVy5ykiePDRD/yzpuXy2hRRfISXxghn+8cAVHDsr6EhDvwgt4vUxj7VIt35u50opOjbBnz/aNw+scHdOrow31D1VyUyQjglSmfjGazeM84st2Gi55BUeTorUvSh/FwR6cPaVmWjB1gkiaceS77qqhq154vTuaYJ+9m1VOniWPZmFkcAHQ4E6kjYVAR5yziKJknMqtba7T/n1ouo/UW4ebouuuZnXKrIBRu4mlVMhD3SvjRY8CoyBo7261KEzCAnGAVsg== 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=7DLQ4NeiftFPJUUmf2KpLAQzH8CH14nB7VBGHvFC904=; b=A1+HkoywGki9Bu1MtcrB8AcEiQkiVQYGrUqh3VvM1rdKE/wN0IOKm4kDyoXQiEDIqcEzOUp/bCtj30Qeo+Y7PKQkMpDBVBj67TFw4NTSpnidCDSYhUy/uVltFMVZ5ws8ZfN2zz3/ro+R5nEsT5ur8ySxEEL8B4uYv4Jo8eFeLTM= Received: from SJ0PR11MB4974.namprd11.prod.outlook.com (2603:10b6:a03:2d6::13) by BYAPR11MB3061.namprd11.prod.outlook.com (2603:10b6:a03:83::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Tue, 12 Oct 2021 08:37:24 +0000 Received: from SJ0PR11MB4974.namprd11.prod.outlook.com ([fe80::7820:b346:edd1:f07]) by SJ0PR11MB4974.namprd11.prod.outlook.com ([fe80::7820:b346:edd1:f07%3]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 08:37:24 +0000 From: "Ma, Hua" To: "Bi, Dandan" , "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: AQHXvo0rIkUzzA5/y0uYr39IMd8UTavOwdGAgABJfvA= Date: Tue, 12 Oct 2021 08:37:24 +0000 Message-ID: References: <7c0683f0a02729d8c75dcb631fec2941c834629e.1633948972.git.hua.ma@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows 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: 5c4bbcd7-49da-4f76-9feb-08d98d5b8417 x-ms-traffictypediagnostic: BYAPR11MB3061: 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: VhzLqHnpDHTyJsRbIC6o5ltw2rFdo5siwACYK3QMtIoz4ocD031LNoY0hHF3ANMKsXxKlos6y79iikAtspQyJaSXMIAaN/jqEvua4UHl2ba061Y5xJGliOC4B0lJ5QINwzRMGj+6b/11V7CG4i5ifHODzQS4168Hn5r4n5yQixs1QxbChOYpZ4BmZFIW1k+0AZS1Uf4tinR3oXmD7fcyrp1wHI6pBP9K0Tr5NSINQlKaFMslCs34EKqNz1nV38wG1PbawA5PM47p9vQpXbuLbIWGYSihYwv94ap4o5lDEWi58x1X1OnDUam4o+46tFOA7o+HM19M5sOny+h1deGyQqNX3TUgR7epSjpmQCWpb6S9bCTMOgSME/Ip0u83HZ8XnMJF2+7ojfu0MrCJtPvjbY84iQVqcUyFBvuMkUdgg5dCghTmlaWDFEyhNgRqzMGadEIFlZCRJydYv6L5qB5SvMJ01eONQ4yKVMwbxXS+HBn3Nl+woslztiRc7Cu/GUkFRT2vhgNlOM5lEXUKH+OIyodzHzUOCGIU42HiJe5mttA+czeuPuS8F1qWXKYmqOsJmc1yRTZdRK5dPHlMX6J/Vt8spJaq5ZSH2DOB1YYET3op94cgr8ARAUuSJ2uXYQ56BJn8H70EPbDUaWF9MXbjPBvlD2gV1+Y3yve3CSrsvmgBG21oPEWd3u4SDKCRpjfy5tQCNzugrMK4+dPfyHc2zaET/4yloVhzYmUJXFIwF/coEXAuF4mbT2cqYjMmXrfE9Y3toGwa/AcqHvXP1R94hi8xVOYSLS4EE5aITWNDnTQ= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4974.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(71200400001)(5660300002)(9686003)(54906003)(53546011)(508600001)(966005)(66446008)(110136005)(38100700002)(6506007)(55016002)(316002)(76116006)(186003)(8936002)(2906002)(4326008)(66556008)(86362001)(38070700005)(33656002)(83380400001)(64756008)(66946007)(7696005)(8676002)(66476007)(26005)(107886003)(122000001)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eH86jIluoBJaJZHVGmSVMmoBWhzg0YfWA9u/v5J5cmld4uZAeF0JaKSd/EOi?= =?us-ascii?Q?VW7uOFcc5BYYP3gqkFjHP4tf87x1Uk0zI56HJXXJ4YNoqkc/Dag6wjIl6Zxx?= =?us-ascii?Q?OR1Jjs8wQm+fduCZi/zbjAFSuQqT4ZSm1xzcB/oEALRaDSFS/ecqxKivD10K?= =?us-ascii?Q?QIeiKr0mpc1r4l1kLPEhe+NsdQr995a0FNnigWe2xS5sf9cqDnpdDOT4Hixz?= =?us-ascii?Q?QKl/PD6GGFSiS5zjkVf5T4zOqPBb4+XFkiOPuSgG5ds1qe+v4gw0YdJSnM4/?= =?us-ascii?Q?qI7umgEmwvYaPdCoRGaKIoB68Dk6p3szafN90x0V323k1eN91l3hObcfQDTz?= =?us-ascii?Q?kEGp6ByCeESk2TD09chW0T6twyc+qEPEYO5vEEBpAjVZQMiJ/BbBYesyuwX8?= =?us-ascii?Q?0vR0ZngKESfubDHWIvXrpjSjGGHkJsNwGIw+HyHqxPk7IG4kL2i2TKDeZ1Eo?= =?us-ascii?Q?WicKPKxet/eYeZx2d/9a1o8rTH/d7aDShBBsGSG+MOAbdOEiQTvH3P5O2J6O?= =?us-ascii?Q?gVHnK8G4RMeVlZScVjPkLirxnrKLQBuXZ1fwdIi+tV3iLEJPEvQzhyfMdux1?= =?us-ascii?Q?6M1eTAdzspcqzm5rhXbfGouK1Rp2gMgzvNgUgT02q8eY7Wuy/D4DcUtb20Gd?= =?us-ascii?Q?s00OnCs2PidNfeURlsC0rd/KuA3EneH1gEZ9/SATRYTlHoBVR00XCIyQl/jO?= =?us-ascii?Q?sYz8W7mpXikQHV/vn2wiZ31WYX5PqGo6OUPY28grX0EseNvGnFic8Epc+S+5?= =?us-ascii?Q?Zeh3GEF4fP8FrEpK7BYBY1JzkC2SBNAqB0ioRR43Xbl3elbWd3HqRO9iNAnT?= =?us-ascii?Q?TuKO0sIZhqG+fVjOFddDNBtr/vFcs7ek/DxcQl6p9ex33D1Xm7sjl4hCLljb?= =?us-ascii?Q?lxT2qv8EKjX5b53+GnojFBN386eCKqvlwmne3eOEiJ7tLkzgygaDl3HH2cZR?= =?us-ascii?Q?fh43zIhLBAtFuMMG+7D9CJEIZZ3m7l7CpSCivkGUkhSNhgEOVHcyma+ezFK6?= =?us-ascii?Q?nC8eghkfeqFk0hNeSVb/r8R3PERjeDI+cho4eWZzfQEJkk0QfmF0xc+dRYoT?= =?us-ascii?Q?GOFOYE12Rb6PEKgnMWTxE1DG9vhJXctjO83IPZvokq2wAAruyVjYpl0MMcIn?= =?us-ascii?Q?9nx37474EGP3WVqB6qxzmfg395MUA/akMc42c0tz/q/tn+fjbFxbrIeiWnhh?= =?us-ascii?Q?5VgDo9a44ptqhZ0uNZP9f3T2sxIt3zaSLu61P0yJ/BoNS4yGFYraXOS1wIOu?= =?us-ascii?Q?aUaejf8F87335ddxkqVKxlwRUR8vgMSWKZH27Tiyb6AmcNvmGKSKAUttY/d9?= =?us-ascii?Q?9A06hI/9TfvXqx01c/sN/Gnn?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4974.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c4bbcd7-49da-4f76-9feb-08d98d5b8417 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 08:37:24.5694 (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: AK8l+naZvjxK5R9L1zdSrqurWO4hwgTv8zzKeHufoWM2lnDqwOFvbAJR9aTZ0Xhs4y3U/MxNih8lrGHKOfBuDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3061 Return-Path: hua.ma@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Dandan, Thanks for the comment. Patch v2 is just sent with the update. Please help to review. Thank you, Ma Hua > -----Original Message----- > From: Bi, Dandan > Sent: Tuesday, October 12, 2021 12:13 PM > 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 >=20 > Hi Hua, >=20 > One minor comment inline, please check. >=20 >=20 >=20 > Thanks, > Dandan >=20 > > -----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 > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3680 > > > > This patch fixes the following issue: > > > > The global variable gHandleList is a linked list. > > This list is locked when a entry is added or removed from the list, but= there > is no > > lock when iterating this list in function CoreValidateHandle(). > > It can lead to "Handle.c (76): CR has Bad Signature" assertion if the i= terated > > entry in the list is just removed by other task during iterating. > > Locking the list when iterating can fix this issue. > > > > 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(-) > > > > 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 +2= 68,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 > > > > @param UserHandle The handle to check > > + @param IsLocked The protocol lock is acquried or not > > > > @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. > > > > **/ > > EFI_STATUS > > CoreValidateHandle ( > > - IN EFI_HANDLE UserHandle > > + IN EFI_HANDLE UserHandle, > > + IN BOOLEAN IsLocked > > ) > > { > > IHANDLE *Handle; > > LIST_ENTRY *Link; > > + EFI_STATUS Status; > > > > if (UserHandle =3D=3D NULL) { > > return EFI_INVALID_PARAMETER; > > } > > > > + if (IsLocked) { > > + ASSERT_LOCKED(&gProtocolDatabaseLock); > > + } else { > > + CoreAcquireProtocolLock (); > > + } > > + > > + Status =3D EFI_NOT_FOUND; > > for (Link =3D gHandleList.BackLink; Link !=3D &gHandleList; Link =3D= Link- > >BackLink) { > > Handle =3D CR (Link, IHANDLE, AllHandles, EFI_HANDLE_SIGNATURE); > > if (Handle =3D=3D (IHANDLE *) UserHandle) { > > - return EFI_SUCCESS; > > + Status =3D EFI_SUCCESS; > > + break; > > } > > } > > > > - return EFI_INVALID_PARAMETER; > > + if (!IsLocked) { > > + CoreReleaseProtocolLock (); > > + } > > + return Status; > > } > > > > > > @@ -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 0= x%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; > > > > - Status =3D CoreValidateHandle (UserHandle); > > + Status =3D CoreValidateHandle (UserHandle, TRUE); > [Dandan] As current all callers of CoreGetProtocolInterface () has acquir= ed > the lock, it's OK to pass TRUE to indicate the lock is acquired. > I am just thinking about following small question. > Could we add some comments to explain why it's true here and also notify > that caller should also acquire the lock firstly by itself if there is an= y new caller > added to call this function? >=20 > > 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; > > > > - 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 > > ); > > > > // > > 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; > > > > - Status =3D CoreValidateHandle (UserHandle); > > + Status =3D CoreValidateHandle (UserHandle, FALSE); > > if (EFI_ERROR (Status)) { > > return Status; > > } > > -- > > 2.32.0.windows.2