diff options
| author | Kun Qin <kuqin@microsoft.com> | 2026-08-25 00:29:20 +0300 |
|---|---|---|
| committer | Ard Biesheuvel <ardb@kernel.org> | 2026-09-02 11:52:17 +0300 |
| commit | 73075417b0bc6d3ec40e8ec060f858bc7036954b (patch) | |
| tree | 322107eca4306dec11dd722af030f5574f724386 /MdeModulePkg/Library/PiDxeS3BootScriptLib | |
| parent | 97f4cc402a80b1964f4f97b19039205ef8b9aa52 (diff) | |
| download | edk2-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')
0 files changed, 0 insertions, 0 deletions
