From nobody Mon Apr 29 01:27:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 150983162660713.76186242675567; Sat, 4 Nov 2017 14:40:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0003120352602; Sat, 4 Nov 2017 14:36:26 -0700 (PDT) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C3702202E5E58 for ; Sat, 4 Nov 2017 14:36:25 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id r68so7583564wmr.3 for ; Sat, 04 Nov 2017 14:40:22 -0700 (PDT) Received: from localhost.localdomain ([105.129.222.2]) by smtp.gmail.com with ESMTPSA id e77sm5443350wmi.16.2017.11.04.14.40.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Nov 2017 14:40:18 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0UmGoFmFEN7Vk9Ca4lQEs7li0h5oO8tJ9h34q+D7VMo=; b=J0jH0uhs0K8ZkH0rRxccs7g6cVyonWHdLmD4kSeedWWvtM3cmGe9OopWyXOi/6fD/i 9twg39FkuYiUmIHYxWp60gPPECLfIwSiGXkiRsEQewMmRmY1qRs7zfWHEbGshUYqOZ9G /vyq0hXd7/ptCdlkqzS89cdYvwh+yFIX4wF1Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0UmGoFmFEN7Vk9Ca4lQEs7li0h5oO8tJ9h34q+D7VMo=; b=b1JkuPko5jifaDCueOIZO2MnzPkPn109pgKK6m3KY+4mZypCgW83yx6YyRsF0OcyUH akcLNu1MEeQNeB4KKQLPpysfn8g03cD3SQdx43d5iRUBP5LXOP3jVPefsD4pCLF4WCzl HZNSv9MZP0KobNYx0BYYhgEvGoiRnA5cNAf2z8qm4XjWk6Cco067i7kzjeksxPktJfVJ 1+KnmL3LaY0J6ut1+jFoZ398XtTHh5QWts6t9kvE38HYR45DAk0fF1U/CK9xevHzWwLR lg9GowoBLalUdpye7C3Zi3RxDleG6nMb5g1Ofi09GCxFbVW3/da7PTUfSCWdH2cKIjEw ilCA== X-Gm-Message-State: AJaThX4h39qJyHPAhRuyt8FDCJmlMqt7j/QcEXaVNmjxFO8uKe0Z6Lf0 irhmnS+JpBK3ya9MezvvLx80zDNGteg= X-Google-Smtp-Source: ABhQp+QVY/jQkYiuKaHfoWuKogJCc1rHIaY+l+mokmaFpXFmINw3+hBiwNd7tJd0SSb2PmliMz8q2g== X-Received: by 10.28.24.70 with SMTP id 67mr1871028wmy.7.1509831620239; Sat, 04 Nov 2017 14:40:20 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sat, 4 Nov 2017 21:40:12 +0000 Message-Id: <20171104214012.30888-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] MdeModulePkg/SdMmcPciHcDxe: use FreeBuffer not FreePages from DMA buffer X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: feng.tian@intel.com, eric.dong@intel.com, star.zeng@intel.com, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Don't use EFI_PCI_IO_PROTOCOL::FreePages () to free an allocation created with EFI_PCI_IO_PROTOCOL::AllocatePages (). It is simply incorrect, but given that it may interfere with IOMMU DMA protection and/or memory encryption, it could pose a security risk as well. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModule= Pkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c index 23faec5e2be0..a6005dd33bce 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c @@ -1009,7 +1009,7 @@ SdMmcPassThruPassThru ( =20 Done: if ((Trb !=3D NULL) && (Trb->AdmaDesc !=3D NULL)) { - FreePages (Trb->AdmaDesc, Trb->AdmaPages); + Private->PciIo->FreeBuffer (Private->PciIo, Trb->AdmaPages, Trb->AdmaD= esc); } =20 if (Trb !=3D NULL) { --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel