/[packages]/cauldron/edk2/current/SOURCES/0023-NetworkPkg-UefiPxeBcDxe-Add-EXCLUSIVE-attribute-when.patch
ViewVC logotype

Contents of /cauldron/edk2/current/SOURCES/0023-NetworkPkg-UefiPxeBcDxe-Add-EXCLUSIVE-attribute-when.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1330132 - (show annotations) (download)
Fri Nov 16 09:43:44 2018 UTC (5 years, 5 months ago) by tv
File size: 2993 byte(s)
- Fix passing through RPM build flags (rhbz#1540244)
- Fix network boot via grub (bz 1648476)
- Explicitly compile the scripts using py_byte_compile
- Add -qosb dependency on python3
1 From cde5a72d365eff5b02b8330fef1c8d36fced08eb Mon Sep 17 00:00:00 2001
2 From: "edk2-devel-bounces@lists.01.org" <edk2-devel-bounces@lists.01.org>
3 Date: Fri, 14 Sep 2018 16:24:15 +0800
4 Subject: [PATCH] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE attribute when
5 opening SNP protocol installed by PXE.
6
7 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1152
8
9 v2: Sync the same logic to Ipv6 and update code comments.
10
11 The PXE driver installs a SNP and open this SNP with attribute BY_DRIVER
12 to avoid it being opened by MNP driver, this SNP is also expected not to
13 be opened by other drivers with EXCLUSIVE attribute. In some cases, other
14 drivers may happen to do this by error, and thus cause a system crash.
15 This patch adds EXCLUSIVE attribute when opening SNP in PXE driver, and
16 will reject all OpenProtocol requests by EXCLUSIVE.
17
18 Cc: Subramanian, Sriram <sriram-s@hpe.com>
19 Cc: Ye Ting <ting.ye@intel.com>
20 Cc: Fu Siyuan <siyuan.fu@intel.com>
21 Cc: Wu Jiaxin <jiaxin.wu@intel.com>
22 Contributed-under: TianoCore Contribution Agreement 1.1
23 Signed-off-by: Wang Fan <fan.wang@intel.com>
24 Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
25 Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
26 Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
27 ---
28 NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 8 ++++----
29 1 file changed, 4 insertions(+), 4 deletions(-)
30
31 diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
32 index bc9dc914f3..0ab640beca 100644
33 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
34 +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
35 @@ -814,7 +814,7 @@ PxeBcCreateIp4Children (
36 }
37
38 //
39 - // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
40 + // Open SNP on the child handle BY_DRIVER|EXCLUSIVE. It will prevent any additionally
41 // layering to perform the experiment.
42 //
43 Status = gBS->OpenProtocol (
44 @@ -823,7 +823,7 @@ PxeBcCreateIp4Children (
45 (VOID **) &Snp,
46 This->DriverBindingHandle,
47 Private->Ip4Nic->Controller,
48 - EFI_OPEN_PROTOCOL_BY_DRIVER
49 + EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE
50 );
51 if (EFI_ERROR (Status)) {
52 goto ON_ERROR;
53 @@ -1157,7 +1157,7 @@ PxeBcCreateIp6Children (
54 }
55
56 //
57 - // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
58 + // Open SNP on the child handle BY_DRIVER|EXCLUSIVE. It will prevent any additionally
59 // layering to perform the experiment.
60 //
61 Status = gBS->OpenProtocol (
62 @@ -1166,7 +1166,7 @@ PxeBcCreateIp6Children (
63 (VOID **) &Snp,
64 This->DriverBindingHandle,
65 Private->Ip6Nic->Controller,
66 - EFI_OPEN_PROTOCOL_BY_DRIVER
67 + EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE
68 );
69 if (EFI_ERROR (Status)) {
70 goto ON_ERROR;
71 --
72 2.17.1
73

  ViewVC Help
Powered by ViewVC 1.1.30