MdeModulePkg: PiSmmIpl: Add check for MM communicate v3 header
This change adds a check to ensure the incoming buffer is correctly using MM communicate v3 header before dereferencing the content. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
@@ -737,6 +737,13 @@ MmCommunicationMmCommunicate3 (
|
||||
}
|
||||
|
||||
CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER_V3 *)CommBufferVirtual;
|
||||
if (!CompareGuid (
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
&gEfiMmCommunicateHeaderV3Guid
|
||||
))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = SafeUint64Add (sizeof (EFI_MM_COMMUNICATE_HEADER_V3), CommunicateHeader->MessageSize, &MinCommSize);
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
||||
Reference in New Issue
Block a user