Reviewed-by: Wu Jiaxin <jiaxin...@intel.com>

Thanks,
Jiaxin

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org]
> Sent: Friday, September 14, 2018 3:39 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] NetworkPkg: UefiPxeBcDxe: Add EXCLUSIVE
> attribute when opening SNP protocol installed by PXE.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1152
> 
> 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 <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Wu Jiaxin <jiaxin...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to