]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: MmCommunicationDxe: Update MM communicate `CommBuffer**` checks
authorKun Qin <kuqin12@gmail.com>
Tue, 25 Jan 2022 19:39:07 +0000 (03:39 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 27 Jan 2022 02:16:17 +0000 (02:16 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3751

Current MM communicate routine from ArmPkg would conduct few checks prior
to proceeding with SMC calls. However, the inspection step is different
from PI specification.

This patch updated MM communicate input argument inspection routine to
assure that return code `EFI_INVALID_PARAMETER` represents "the
`CommBuffer**` parameters do not refer to the same location in memory",
as described by `EFI_MM_COMMUNICATION2_PROTOCOL.Communicate()` section
in PI specification.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c

index 7f756a32d4e0be782f0585b79f16c7643076e325..0283be430dffed53475a4fe9866968a9e6bdfdd9 100644 (file)
@@ -83,7 +83,7 @@ MmCommunication2Communicate (
   //\r
   // Check parameters\r
   //\r
-  if (CommBufferVirtual == NULL) {\r
+  if ((CommBufferVirtual == NULL) || (CommBufferPhysical == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r