summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorAnandh Krishna U <anandhkrishnau@ami.com>2026-09-23 13:19:52 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-09-29 09:13:02 +0300
commit75400a462b52c349dd070e6f6d435511cbf7db13 (patch)
treeb7b55761ea34190bbb7004e91aa98f1fff138258 /BaseTools/Source/Python
parent1d8f64df1083bb2b7a29a6cf7ceb5323912cf5e0 (diff)
downloadedk2-75400a462b52c349dd070e6f6d435511cbf7db13.tar.xz
SecurityPkg/FmpAuthenticationLibPkcs7: Use pages for scratch buffer
FmpAuthenticatedHandlerPkcs7() allocates a scratch buffer whose size is (ImageSize - AuthInfo.Hdr.dwLength): the full firmware payload plus the 8-byte monotonic count, assembled contiguously for Pkcs7Verify(). The library declares support for the DXE and post-memory PEI phases. In PEI, MemoryAllocationLib's AllocatePool() maps to PeiAllocatePool(), which builds an EFI_HOB_TYPE_MEMORY_POOL HOB and rejects any request larger than (0xFFF8 - sizeof (EFI_HOB_MEMORY_POOL)), i.e. just under 64 KiB. PeiAllocatePool() itself notes that a post-memory PEIM wanting a larger pool should use the AllocatePages service instead. As a result, authenticating any image whose payload exceeds that limit fails at allocation with RETURN_OUT_OF_RESOURCES before Pkcs7Verify() is ever called. Callers that map this to a status code report an authentication/security failure for an otherwise validly signed image. Allocate the scratch buffer with AllocatePages (EFI_SIZE_TO_PAGES (Size)) and release it with the matching FreePages (). The data assembled for Pkcs7Verify() is unchanged, so authentication results are identical for valid and invalid signatures. The DXE phase is unaffected because its pool allocator has no comparable size limit. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chris Fernald <chfernal@microsoft.com> Signed-off-by: Anandh krishna U <anandhkrishnau@ami.com>
Diffstat (limited to 'BaseTools/Source/Python')
0 files changed, 0 insertions, 0 deletions