Revision: 18435
          http://sourceforge.net/p/edk2/code/18435
Author:   luobozhang
Date:     2015-09-10 09:46:59 +0000 (Thu, 10 Sep 2015)
Log Message:
-----------
MdeModulePkg: PXE Driver's LoadFile protocol should check FilePath

PXE driver's LoadFile protocol should check the input parameter
FilePath to see whether it's a supported device path.If not,
it should return invalid parameter, do not continue PXE boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Ye Ting <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
    trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h

Modified: trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c  
2015-09-10 07:02:12 UTC (rev 18434)
+++ trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c  
2015-09-10 09:46:59 UTC (rev 18435)
@@ -2776,6 +2776,10 @@
   UINT64                      TmpBufSize;
   BOOLEAN                     MediaPresent;
 
+  if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {
+    return EFI_INVALID_PARAMETER;
+  }
+  
   Private         = PXEBC_PRIVATE_DATA_FROM_LOADFILE (This);
   PxeBc           = &Private->PxeBc;
   NewMakeCallback = FALSE;

Modified: trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h  
2015-09-10 07:02:12 UTC (rev 18434)
+++ trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h  
2015-09-10 09:46:59 UTC (rev 18435)
@@ -33,6 +33,7 @@
 #include <Protocol/Ip4Config2.h>
 
 #include <Library/DebugLib.h>
+#include <Library/DevicePathLib.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/MemoryAllocationLib.h>
 #include <Library/UefiDriverEntryPoint.h>


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to