]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: EfiUnacceptedMemoryType is not allowed in AllocatePool
authorMin M Xu <min.m.xu@intel.com>
Wed, 18 Jan 2023 08:41:58 +0000 (16:41 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 7 Feb 2023 05:33:38 +0000 (05:33 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4315

MemoryType of EfiUnacceptedMemoryType should not be allocated in
AllocatePool. Instead it should return EFI_INVALID_PARAMETER.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Michael Roth <michael.roth@amd.com>
Reported-by: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Core/Dxe/Mem/Pool.c

index 7aaf501600cf2821be2dc524b2dd40a48fe66678..b20cbfdedbab88fa87e45ba2d9a017288fd5b2da 100644 (file)
@@ -213,7 +213,7 @@ CoreInternalAllocatePool (
   // If it's not a valid type, fail it\r
   //\r
   if (((PoolType >= EfiMaxMemoryType) && (PoolType < MEMORY_TYPE_OEM_RESERVED_MIN)) ||\r
-      (PoolType == EfiConventionalMemory) || (PoolType == EfiPersistentMemory))\r
+      (PoolType == EfiConventionalMemory) || (PoolType == EfiPersistentMemory) || (PoolType == EfiUnacceptedMemoryType))\r
   {\r
     return EFI_INVALID_PARAMETER;\r
   }\r