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 <l...@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Bret Barkelew <bret.barke...@microsoft.com>
Cc: Michael Kubacki <michael.kuba...@microsoft.com>
Cc: Sami Mujawar <sami.muja...@arm.com>

Signed-off-by: Kun Qin <kuqi...@gmail.com>
Reviewed-by: Sami Mujawar <sami.muja...@arm.com>
---

Notes:
    v2:
    - Splitting patch into 2 of 4 [Ard]
    - Uncrustify style update
    
    v3:
    - Added cc entry and reviewed-by tag [Sami]

 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.34.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86069): https://edk2.groups.io/g/devel/message/86069
Mute This Topic: https://groups.io/mt/88680223/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to