mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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> |
||
|---|---|---|
| .. | ||
| Core | ||
| Drivers | ||
| Include | ||
| Library | ||
| StandaloneMmPkg.ci.yaml | ||
| StandaloneMmPkg.dec | ||
| StandaloneMmPkg.dsc | ||