From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mx.groups.io with SMTP id smtpd.web11.751.1640050453513536920 for ; Mon, 20 Dec 2021 17:34:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c2RYz1gS; spf=pass (domain: gmail.com, ip: 209.85.216.41, mailfrom: kuqin12@gmail.com) Received: by mail-pj1-f41.google.com with SMTP id co15so11040141pjb.2 for ; Mon, 20 Dec 2021 17:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q5aXQK30DnpMcLrj32ScW3Xw1Mw9woWWcYs1cYJnEHM=; b=c2RYz1gSNoJWLct1/96vpj0Zyla7DmCHGcutSRDXrkMixSrrihXvsVM/FSFr7fL2/5 /bGRaABX2xOFvO9oJgcCPRizkYtcLXSnQV/1+PHX4+PEIt8UualEPSmhB1ZbuUwKzdGO wpa1GxKVtURqmxOUK1zKceEPyaE2dX2HxwIW7tRjexJZAmHWXWFqZRnY/9i14gpcqTbr jGmMXPI37GitFl3BFXTkt2ts9LvDulv41rJ0jEcJxbjGijb2FIHJk5Ng6ISTaGySfHYC CQASQwdfoquZh27QJC2QE/f7EaeeqSGm8wZtNAi5ePaf67xpen9vr1xkFbFtlkUaFwjx w0hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q5aXQK30DnpMcLrj32ScW3Xw1Mw9woWWcYs1cYJnEHM=; b=opTexxW7W+k3uacQdtKZwdLqaGWqDqeiqY4GqFv5CbGUpL3UxCXdrUNkqHEY772ryc Xkb+8u4ewKUNUqK/eFPobfKj3BNTqn5toFwscbYDeb5l8vGhF9vau125ZnSbX61tRTtJ sDmg0bhOA+o4M26dm3N6RqaIwevGqrk7z9Kqv/uKwzNFe2kJuHXCR784ZPhQrng7BiN8 OzQT5Zcucm/k5Emz17xbINfNxDoBaAQuW0WDvmab3hNPLCzn8bGlIlBmVjF+U3cVMwYQ iEEZ6Hjzbls26OnQCtlTYDLwqRUO8ZITXX9a4hitx24S1l4p3iJHgOdcA284J8rq0Oe7 lhBA== X-Gm-Message-State: AOAM533HQSoctCkSt56LJRSipSQd9ise07NJXTmSHM7FjfHU+/T8n3R9 yB+lHzc5sVhGDz0NWotW8T5ZNnhT+2ajoQ== X-Google-Smtp-Source: ABdhPJzqNHZHYTmx4E5rQZOIH4N51gPbIysjI7MoFxYWCXJNccu6PU3bz4CANTeht7ipacrr4YK4iw== X-Received: by 2002:a17:90a:db0f:: with SMTP id g15mr1213813pjv.76.1640050452986; Mon, 20 Dec 2021 17:34:12 -0800 (PST) Return-Path: Received: from localhost.localdomain ([50.35.74.198]) by smtp.gmail.com with ESMTPSA id m10sm17389189pgv.75.2021.12.20.17.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 17:34:12 -0800 (PST) From: "Kun Qin" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Bret Barkelew , Michael Kubacki Subject: [PATCH v2 4/6] ArmPkg: MmCommunicationDxe: Update MM communicate `CommBuffer**` checks Date: Mon, 20 Dec 2021 17:33:32 -0800 Message-Id: <20211221013334.1751-5-kuqin12@gmail.com> X-Mailer: git-send-email 2.32.0.windows.1 In-Reply-To: <20211221013334.1751-1-kuqin12@gmail.com> References: <20211221013334.1751-1-kuqin12@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Ard Biesheuvel Cc: Bret Barkelew Cc: Michael Kubacki Signed-off-by: Kun Qin --- 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