[edk2-devel] [PATCH v2 4/6] ArmPkg: MmCommunicationDxe: Update MM communicate `CommBuffer**` checks

Kun Qin kuqin12 at gmail.com
Tue Dec 21 01:33:32 UTC 2021


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 at nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
Cc: Michael Kubacki <michael.kubacki at microsoft.com>

Signed-off-by: Kun Qin <kuqin12 at gmail.com>
---

Notes:
    v2:
    - Splitting patch into 2 of 4 [Ard]
    - Uncrustify style update

 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
index 7f756a32d4e0..0283be430dff 100644
--- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
+++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
@@ -83,7 +83,7 @@ MmCommunication2Communicate (
   //
   // Check parameters
   //
-  if (CommBufferVirtual == NULL) {
+  if ((CommBufferVirtual == NULL) || (CommBufferPhysical == NULL)) {
     return EFI_INVALID_PARAMETER;
   }
 
-- 
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85120): https://edk2.groups.io/g/devel/message/85120
Mute This Topic: https://groups.io/mt/87869776/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list