From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web12.1943.1643139558271877052 for ; Tue, 25 Jan 2022 11:39:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZH1/oMdw; spf=pass (domain: gmail.com, ip: 209.85.216.52, mailfrom: kuqin12@gmail.com) Received: by mail-pj1-f52.google.com with SMTP id d5so18542460pjk.5 for ; Tue, 25 Jan 2022 11:39:18 -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=9D33y6UCtwttBlL6/ErMIcUE4BMnOhG81Ykuqldnjfg=; b=ZH1/oMdwXBbp2M9VG36YNYQhY2T/AbzCo8tk0HJAR6gNcBlzFETGAvB420pKYybH39 myIG1r/LLa/NzP9mgcHTpQpkfB8KBAaSz5SQqMrIQ7awEVwn2O0zxFR4bal/nTJQ1vSt yeiX1yoS1/d5lnO7iy649IHitzZYsy6Dz8tSwCjuTp3QxmNtn3EYCOLUWRCBc/15D+Yp mGi7M7AiXCKxzTJgVEXOTpUWpVZDWp5dlJZxsJa9aR/Hd9mWKc0WwXw9xmUiX8WxmrM7 DlGTcWO7ABIMzjbTV6aACDSZlv6Pt5xuOdaeaLrWlKYx5ZBZj2VVf9pjVA8e4P5VsdYU AQxw== 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=9D33y6UCtwttBlL6/ErMIcUE4BMnOhG81Ykuqldnjfg=; b=1i0LkmDCNSKB2O7eiievi3uy5ly3kSpCmBTicyymB0MOMkoGRjSKn6XvoxE3L9Wsn3 YAMl0/PYW+ryUkehISdWWW/2Jtf3dGEmcpjUMpOPmPSL0qXwW99FBj2rtEuUwmngsg44 QGQVATlnyYOhVYdHLFq1FJwKwPDJJvInHqufTP/j+RTdUR6OtA4QF9N6w/5NriV/38IK Z+dPsZiPPD88srHSjPJxSKlOgcvHhAsUbuOYM8km0ug7v3WQZ0WAgcjo/+EPMLy/itck 8619dAtY/VqZt8dQkdgycObnEOAas3odreIC+A0CAY6r7YwQZL5JMG97AUIZ8pIVS6y6 tHlA== X-Gm-Message-State: AOAM530SgKYqsI9HAQOSCosN7NR8bzme+ZCKOaALkHcDXWMLpejTLvkH ZIlXn6Hr04HBSUImF1cx1qM4vcghIc8= X-Google-Smtp-Source: ABdhPJwtgrxXBgkzK9vNRT2sBrS2O2dTlB4iZtMvJqIFy7kUjXUOxXppwKHK+Pm0NkJd0CH/GbsvJQ== X-Received: by 2002:a17:902:704a:b0:14a:b62b:f41b with SMTP id h10-20020a170902704a00b0014ab62bf41bmr20140833plt.93.1643139557593; Tue, 25 Jan 2022 11:39:17 -0800 (PST) Return-Path: Received: from gem-name-lb-02.localdomain ([50.35.74.198]) by smtp.gmail.com with ESMTPSA id v8sm1036929pju.51.2022.01.25.11.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 11:39:17 -0800 (PST) From: "Kun Qin" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Bret Barkelew , Michael Kubacki , Sami Mujawar Subject: [PATCH v3 4/6] ArmPkg: MmCommunicationDxe: Update MM communicate `CommBuffer**` checks Date: Tue, 25 Jan 2022 11:39:07 -0800 Message-Id: <20220125193909.491-5-kuqin12@gmail.com> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220125193909.491-1-kuqin12@gmail.com> References: <20220125193909.491-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 Cc: Sami Mujawar Signed-off-by: Kun Qin Reviewed-by: Sami Mujawar --- 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