[edk2] [PATCH 0/3] Fix misuses of AllocateCopyPool

Jian J Wang posted 3 patches 7 years, 1 month ago
Failed in applying to current master (apply log)
There is a newer version of this series
.../Universal/BdsDxe/DeviceMngr/DeviceManager.c                |  4 +++-
MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c  |  3 ++-
.../BootMaintenanceManagerCustomizedUiSupport.c                |  3 ++-
MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c        |  4 +++-
MdeModulePkg/Library/UefiHiiLib/HiiLib.c                       | 10 ++++++----
.../Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c       |  3 ++-
MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c   |  3 ++-
ShellPkg/Application/Shell/Shell.c                             |  4 +++-
.../Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c  |  6 ++++--
9 files changed, 27 insertions(+), 13 deletions(-)
[edk2] [PATCH 0/3] Fix misuses of AllocateCopyPool
Posted by Jian J Wang 7 years, 1 month ago
AllocateCopyPool(AllocationSize, *Buffer) will copy "AllocationSize" bytes of
memory from old "Buffer" to new allocated one. If "AllocationSize" is bigger
than size of "Buffer", heap memory overflow occurs during copy.

The solution is to allocate pool first then copy the necessary bytes to new
memory. This can avoid copying extra bytes from unknown memory range.

Jian J Wang (3):
  MdeModulePkg: Fix misuses of AllocateCopyPool
  ShellPkg: Fix misuses of AllocateCopyPool
  IntelFrameworkModulePkg: Fix misuses of AllocateCopyPool

 .../Universal/BdsDxe/DeviceMngr/DeviceManager.c                |  4 +++-
 MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c  |  3 ++-
 .../BootMaintenanceManagerCustomizedUiSupport.c                |  3 ++-
 MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c        |  4 +++-
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c                       | 10 ++++++----
 .../Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c       |  3 ++-
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c   |  3 ++-
 ShellPkg/Application/Shell/Shell.c                             |  4 +++-
 .../Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c  |  6 ++++--
 9 files changed, 27 insertions(+), 13 deletions(-)

-- 
2.14.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel