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.88; helo=mga01.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel-bounces@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 23646211300AE; Fri, 14 Sep 2018 00:45:20 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2018 00:45:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,372,1531810800"; d="scan'208";a="257180632" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 14 Sep 2018 00:44:30 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 14 Sep 2018 00:44:30 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 14 Sep 2018 00:44:29 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.150]) with mapi id 14.03.0319.002; Fri, 14 Sep 2018 15:44:27 +0800 From: "Wu, Jiaxin" To: edk2-devel , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [edk2] [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE attribute when opening SNP protocol installed by PXE. Thread-Index: AQHUS/5ei2Ak1XJXzkK0CfrB0ZvmVKTvZV5A Date: Fri, 14 Sep 2018 07:44:26 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B72741649319B@SHSMSX103.ccr.corp.intel.com> References: <20180914073830.2904-1-fan.wang@intel.com> In-Reply-To: <20180914073830.2904-1-fan.wang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDA5OTllNDctMTEwZS00ZGVhLTgwMjQtNDcwOWFmNDIwZTg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNVdDYXZmcEJwWWk5RHFkY3owaFY5cGx0cllZZ1wvMHlQR2kzNGFRM1BBS1N4T0FrRWJROXNtREQ5bldpM1pPWmIifQ== 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 07:45:21 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] > Sent: Friday, September 14, 2018 3:39 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [edk2] [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE > attribute when opening SNP protocol installed by PXE. >=20 > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1152 >=20 > 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 opened by other drivers with EXCLUSIVE attribute. In some cases, other > drivers 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 > will reject all OpenProtocol requests by EXCLUSIVE. >=20 > 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(-) >=20 > diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c > b/NetworkPkg/UefiPxeBcDxe/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 > + > EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE > ); > if (EFI_ERROR (Status)) { > goto ON_ERROR; > } > } > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel