From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=fan.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9EAA621962301 for ; Fri, 14 Sep 2018 01:07:43 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2018 01:07:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,372,1531810800"; d="scan'208";a="69925377" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 14 Sep 2018 01:07:22 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 14 Sep 2018 01:07:22 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 14 Sep 2018 01:07:22 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Fri, 14 Sep 2018 16:07:19 +0800 From: "Wang, Fan" To: "Subramanian, Sriram" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" , "Wu, Jiaxin" Thread-Topic: [edk2] [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE attribute when opening SNP protocol installed by PXE. Thread-Index: AQHUS/5euMdKKbSzk0i0SAp6lxs436Tu5T+AgACGfPA= Date: Fri, 14 Sep 2018 08:07:18 +0000 Message-ID: References: <20180914073830.2904-1-fan.wang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTVmM2JhNjItYTQ4YS00YWRiLTg1NWYtMDQ0YzUwNjBkYTMzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRUJrRlpXOWxRWHNHa0xYaStCY1FvVFNSWEdBQjROaUdwVDJyZWpBV1Q0T0dVWGtKdWdOMDVlOHVMWXZPU2o2YSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE attribute when opening SNP protocol installed by PXE. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2018 08:07:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks, Shiram, I missed that. Best Regards Fan -----Original Message----- From: Subramanian, Sriram [mailto:sriram-s@hpe.com]=20 Sent: Friday, September 14, 2018 4:05 PM To: Wang, Fan ; edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jia= xin Subject: RE: [edk2] [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE attribu= te when opening SNP protocol installed by PXE. 1. We need to update the comments as well: // // Open SNP on the child handle BY_DRIVER. It will prevent any addition= ally // layering to perform the experiment. // 2. PxeBcCreateIp6Children() will also need to follow the same logic, in my = opinion. Thanks, Sriram. -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Wang= Fan Sent: Friday, September 14, 2018 1:09 PM To: edk2-devel@lists.01.org Cc: Ye Ting ; Fu Siyuan ; Wu Jiaxin= Subject: [edk2] [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE attribute w= hen opening SNP protocol installed by PXE. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1152 The PXE driver installs a SNP and open this SNP with attribute BY_DRIVER to= avoid it being opened by MNP driver, this SNP is also expected not to be o= pened by other drivers with EXCLUSIVE attribute. In some cases, other drive= rs may happen to do this by error, and thus cause a system crash. This patch adds EXCLUSIVE attribute when opening SNP in PXE driver, and wil= l reject all OpenProtocol requests by EXCLUSIVE. Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wang Fan --- NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDx= e/PxeBcDriver.c index bc9dc914f3..1a9671d373 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c @@ -821,11 +821,11 @@ PxeBcCreateIp4Children ( Private->Ip4Nic->Controller, &gEfiSimpleNetworkProtocolGuid, (VOID **) &Snp, This->DriverBindingHandle, Private->Ip4Nic->Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER + =20 + EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE ); if (EFI_ERROR (Status)) { goto ON_ERROR; } } -- 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel