]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: PXE Driver's LoadFile protocol should check FilePath
authorZhang Lubo <lubo.zhang@intel.com>
Thu, 10 Sep 2015 09:46:59 +0000 (09:46 +0000)
committerluobozhang <luobozhang@Edk2>
Thu, 10 Sep 2015 09:46:59 +0000 (09:46 +0000)
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 <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18435 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h

index 4dd7944e6a9a94abda5031ff7c067c6ba057a96a..72923f1b38a4641aee6e6569995118c4c6303d69 100644 (file)
@@ -2776,6 +2776,10 @@ EfiPxeLoadFile (
   UINT64                      TmpBufSize;\r
   BOOLEAN                     MediaPresent;\r
 \r
+  if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
   Private         = PXEBC_PRIVATE_DATA_FROM_LOADFILE (This);\r
   PxeBc           = &Private->PxeBc;\r
   NewMakeCallback = FALSE;\r
index 6e88deae47f3584a4e09778bac9174a80ef25848..ce8d8add3fff7410e97c8545fa3e563ab231bf03 100644 (file)
@@ -33,6 +33,7 @@ typedef struct _PXEBC_PRIVATE_DATA  PXEBC_PRIVATE_DATA;
 #include <Protocol/Ip4Config2.h>\r
 \r
 #include <Library/DebugLib.h>\r
+#include <Library/DevicePathLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r