summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h
diff options
context:
space:
mode:
authorKun Qin <kuqin@microsoft.com>2026-08-25 00:29:20 +0300
committerArd Biesheuvel <ardb@kernel.org>2026-09-02 11:52:17 +0300
commit73075417b0bc6d3ec40e8ec060f858bc7036954b (patch)
tree322107eca4306dec11dd722af030f5574f724386 /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h
parent97f4cc402a80b1964f4f97b19039205ef8b9aa52 (diff)
downloadedk2-73075417b0bc6d3ec40e8ec060f858bc7036954b.tar.xz
StandaloneMmPkg: MmCommunicationDxe: Add integer overflow check
`ProcessCommunicationBuffer()` computes BufferSize by adding a fixed offset (24 bytes) to an attacker-controlled MessageLength (UINT64): `BufferSize = OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data) + CommunicateHeader->MessageLength;` When `MessageLength >= 0xFFFFFFFFFFFFFFE8`, the addition wraps to a small value (0–23 bytes) after UINTN truncation. The subsequent bounds check evaluates FALSE on the wrapped value, bypassing size validation and allowing CopyMem to proceed with a corrupted size into the fixed MM communication buffer. This change added an overflow check before the addition - rejects with EFI_INVALID_PARAMETER if `MessageLength` is greater than `MAX_UINTN - OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data).` Co-authored-by: Gowtham Manikandan <gowthammanikandan@ami.com> Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h')
0 files changed, 0 insertions, 0 deletions