From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.241.140.75; helo=g4t3426.houston.hpe.com; envelope-from=sriram-s@hpe.com; receiver=edk2-devel@lists.01.org Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) (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 6169D21130719 for ; Fri, 14 Sep 2018 01:05:22 -0700 (PDT) Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id 00D076B for ; Fri, 14 Sep 2018 08:05:20 +0000 (UTC) Received: from G2W6311.americas.hpqcorp.net (2002:10c5:4035::10c5:4035) by G2W6311.americas.hpqcorp.net (2002:10c5:4035::10c5:4035) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 14 Sep 2018 08:05:20 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.241.52.12) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 14 Sep 2018 08:05:20 +0000 Received: from DF4PR8401MB1019.NAMPRD84.PROD.OUTLOOK.COM (10.169.87.139) by DF4PR8401MB0955.NAMPRD84.PROD.OUTLOOK.COM (10.169.87.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Fri, 14 Sep 2018 08:05:18 +0000 Received: from DF4PR8401MB1019.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5867:cb5:b9d:5a70]) by DF4PR8401MB1019.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5867:cb5:b9d:5a70%9]) with mapi id 15.20.1143.014; Fri, 14 Sep 2018 08:05:18 +0000 From: "Subramanian, Sriram" To: Wang Fan , "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/41D2yqhdk3QEGw3QBj8Z5rZaTvapew Date: Fri, 14 Sep 2018 08:05:17 +0000 Message-ID: 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: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sriram-s@hpe.com; x-originating-ip: [16.242.235.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DF4PR8401MB0955; 6:OTPq8cVapuTITqjmZZWxNNHl1103E4dsTRRjYn9h+Bb2Rzqqx7Sd4ytpcTmtPbLznC/JoYt6nu9gUH8fyDi7MA1Tif3I+jjvLlpxn9y33WDoBOnda+zN4P3LLGcFGPbSOW30P/fikbwGys/VOdQQQ+lY5f7zxPJuTrOGOV68p/UYbJYEpxpYiMS55y0LZf2UrUbodjD3r10paWlyqQjk0pGA0bSKY5koywRWMkj/EfnQBCzhJhJBgce7659nYnyquKDLygnN03N6oLVVgrs1CQxfkWCr7X7lEC1iJpMANQBGzLSH2w5I6Al68796OKRy0FdBDcKWbH8R0pHYzyE8tm9YrAtgaHcsWhWkRJQ+7bFVvDNgScbLYfD4JGhFDQHqn/vumsugo2CzAPzt7gjpdbwUpJ0UCIi6G+lsCsPlfpiw+4fvWBUk/VC6rO6qou7XfRpDAVr/JJKwkRoMcIu4bA==; 5:9C8/6u7JU9WgqHmk+sjAWsBa7yvGnhz71D3Yjtq+TV1QVOYYkm/C5cTkrq7ZoJdtXv4bDe+k0jupR0FS3NHj1lmnATFIfMibAw9tLAO7xUcpvjM/xtkNIySe+4LVq2Hu1iMIXDHTHYri1vuPd5vYb8oosQykltMcIegWK7pGH88=; 7:1PERYkvJBISkoWDlWo2NK903VIA3yvral5kopcB/KnUv4wgS3PXwtHbkXNQwhOU6fi/iBZLLhQzoCRtTHvtpc/sEF92sM/ldFc854VSvoE2vhzx6H0SS5ZLtm59FiqJr67izemhHd6JnVrrjO/rYdSp4i8stKFE2hdUg4ZPV/hMf7nLzvSQJrsgt5mbUojOQB7sNDGAZNIwvqTTndQuWzuauJ5+F1YS38pXMvHKYMOuKgcxryPGFcfq8fnRcLWh9 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 2c2c9670-7e9d-491f-e6b1-08d61a18cf5d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DF4PR8401MB0955; x-ms-traffictypediagnostic: DF4PR8401MB0955: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(162533806227266)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699050); SRVR:DF4PR8401MB0955; BCL:0; PCL:0; RULEID:; SRVR:DF4PR8401MB0955; x-forefront-prvs: 07954CC105 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(376002)(136003)(39860400002)(346002)(396003)(366004)(199004)(189003)(13464003)(45954006)(86362001)(14454004)(97736004)(2501003)(110136005)(486006)(5250100002)(446003)(476003)(229853002)(11346002)(256004)(2900100001)(19627235002)(54906003)(14444005)(186003)(6306002)(478600001)(26005)(6506007)(6436002)(102836004)(55016002)(9686003)(53936002)(8936002)(33656002)(5660300001)(305945005)(81156014)(7736002)(8676002)(68736007)(74316002)(106356001)(105586002)(66066001)(76176011)(53546011)(6246003)(81166006)(6116002)(25786009)(7696005)(316002)(99286004)(2906002)(966005)(3846002)(4326008); DIR:OUT; SFP:1102; SCL:1; SRVR:DF4PR8401MB0955; H:DF4PR8401MB1019.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: SJELQD25Q21SnQ+SRuP0uceNcpOPnOt1NRNrl3RwAMYlIQDfYYUn2eE0InZ5nxrd/oeQOJBU+ptjIvY9IC491mg4X+XtaSLtyV0l8bn+C1nYvcVQnkJNPPqzYfFoiAjn0PVPBiChmuvaMyCxBz4buQemdB+y+uGYuCGn3Pv80j1TqNTlFARUSSx8+U/Klx/eNrgWBVfC4PRBen28gT6vp8msgL5XKrBPyEf2DCrJ16rZJJM8hFrdDnG7/NrXTdCQRWWUgvtu/lcye9fNV8+OOv0oazQjuuH+qVcM9zcIEfLUPu+y1sqceGWYTY9wsZm37R3Wb4pwSjsWsZeKRsRPeLfp3rcpZa0YaG4MhBLPSxc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2c2c9670-7e9d-491f-e6b1-08d61a18cf5d X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2018 08:05:17.9097 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0955 X-OriginatorOrg: hpe.com 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:05:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 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. 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 + EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIV= E ); if (EFI_ERROR (Status)) { goto ON_ERROR; } } --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel