edk2/StandaloneMmPkg
Michael Kubacki cfe4be367f StandaloneMmPkg/MmCommunicationDxe: Enforce CommSize validation
CommSize is an optional parameter to ProcessCommunicationBuffer().

If it is provided, the size it points to must match the total incoming
comm buffer size (header + data) where that size is calculated as
needed for the comm header version.

If the sizes do not match, the copy from the user provided comm buffer
(pointed to by the CommBuffer parameter) to the shared comm buffer
(mMmCommonBuffer.PhysicalStart) could be incorrect, for example, only
copying part of the buffer.

This change returns EFI_INVALID_PARAMETER if the provided CommSize
does not match the expected size instead of asserting to ensure this
behavior is enforced in scenarios when asserts are disabled and to
allow the caller to operate on the return status.

In addition, for the copy from the user provided buffer to the common
buffer to be valid, the total size must be less than or equal to the
size of the common buffer.  This change adds that validation as well.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-02-23 21:31:57 +00:00
..
Core StandaloneMmPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
Drivers StandaloneMmPkg/MmCommunicationDxe: Enforce CommSize validation 2026-02-23 21:31:57 +00:00
Include StandaloneMmPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
Library StandaloneMmPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
StandaloneMmPkg.ci.yaml StandaloneMmPkg/StandaloneMmPkg.ci.yaml: Add PrEval CI config 2024-09-02 23:20:35 +00:00
StandaloneMmPkg.dec StandaloneMmPkg: Remove FvLib from StandaloneMmPkg 2025-12-04 10:05:40 +00:00
StandaloneMmPkg.dsc StandaloneMmPkg: Correct Build Options for CLANGPDB 2026-01-15 17:10:46 +00:00