Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1098327pxv; Fri, 25 Jun 2021 05:33:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx11F6B+RrQ6tc26JxAAAgoCgO9eTVV6zv9ynsgXzomQmFGjffzzAkSrz/9s7ReJc1r2Cov X-Received: by 2002:a05:6402:35cf:: with SMTP id z15mr14469007edc.208.1624624390633; Fri, 25 Jun 2021 05:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624624390; cv=none; d=google.com; s=arc-20160816; b=hoEFscL8kuB/liFp603xuyJhBLFTftuIpGYoIngQfTZxhGJxqqkNmjxurgJYH8StiN F+F/vhXlCIrqvOQofQnLgyi0JrHETVEh4qr25E8n8q4WbE9tm/ejwWj2aZ3szIoN/dub PsdV4GJWy20g4B6s8+lZfpOG7axzn8hXzoorTWGebGSeKhoVGQXU9ZtKWBDb5kaJVzGB hXGpDVefkSzktZ0jGGBzSqdfXxeopWJpJ7hi8wVuBaeP4MrEodWY1pMNT/LZRyVgtbN0 OrwEo1s6ZaekFqHi5pHwu+vZUBrLkI9rIievTmdyhzLsBAWPcrQZ2oUgibU1fJJBbk9U eSRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=IszdbwdTakhDE7N959V1GOWLyYS2XLAAbOBIn/GfTmA=; b=RfU8jy/zGG6pz7MojGXWcIhH9f/FFVKDeKw7BypimqKEvCcPXgeNUCurZ/OX1wLcEm A38gUBSjKceqn4+o4Y/dkNtISIWH1YIhKA/iQg28vsR4E4t6pHscQTgWQgdncASrBuFL zWJzocnNKyQHN0hC/Pc2k4pM4Y2XN+DnIiFTwVfOL+2CBTX+WGAo3Iks3QHdHhQm25ii x2uLtkgyGreBasaeKk2YTd/D4L4zvErpjW72papkSMcgafu/rb76xw+pNwdUpKu8lLFv Iyg0Ex0EW83BgurBceMF71YDu2KAGiOmK4eZGmMCmRRBfkAeiK7OgZFXTjc3TRGIbJ0B V4kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bCaWwZtC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yh1si5939194ejb.216.2021.06.25.05.32.47; Fri, 25 Jun 2021 05:33:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bCaWwZtC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbhFYMcv (ORCPT + 99 others); Fri, 25 Jun 2021 08:32:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:51312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231273AbhFYMch (ORCPT ); Fri, 25 Jun 2021 08:32:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4C9361463; Fri, 25 Jun 2021 12:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624624216; bh=236dSGX7ExOVPv4h0UeOksGQ8SgYCOQ7aXD3NGK83S0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bCaWwZtC9a0kNjsO191mUbtUcojnviRFMJnXBZ/UQc+wZDgM8hUcreC3qNCEkirNE bbLWlaMbJfBXlg05V08tS0sV+lbJ6mjPNoN7Y8AT15UfxghYQbA3zVDmQkdENHWUeg aoWWbni5r3mbAZmV1yWyb6Qtn3Rm3bH4e4imD6DcErBaFTOVYzmckxYQM6wCi00qxL IKspsHt2W8+A5P7LrhMSB0wLC0J5AtiueFbpUWEKsYqOURtPkRdQJiwA+N05SkMbY0 yNml1K+qGwoAZk+3C0lKdhaf1wsPR1zKe7fVETOXT9FqPpHlh5Z2ca5kWomvg9Dx6c 8Pdmk/dzJ5M/g== Date: Fri, 25 Jun 2021 13:30:05 +0100 From: Will Deacon To: Konrad Rzeszutek Wilk Cc: Claire Chang , Rob Herring , mpe@ellerman.id.au, Joerg Roedel , Frank Rowand , boris.ostrovsky@oracle.com, jgross@suse.com, Christoph Hellwig , Marek Szyprowski , benh@kernel.crashing.org, paulus@samba.org, "list@263.net:IOMMU DRIVERS" , sstabellini@kernel.org, Robin Murphy , grant.likely@arm.com, xypron.glpk@gmx.de, Thierry Reding , mingo@kernel.org, bauerman@linux.ibm.com, peterz@infradead.org, Greg KH , Saravana Kannan , "Rafael J . Wysocki" , heikki.krogerus@linux.intel.com, Andy Shevchenko , Randy Dunlap , Dan Williams , Bartosz Golaszewski , linux-devicetree , lkml , linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xenproject.org, Nicolas Boichat , Jim Quinlan , tfiga@chromium.org, bskeggs@redhat.com, bhelgaas@google.com, chris@chris-wilson.co.uk, daniel@ffwll.ch, airlied@linux.ie, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, jxgao@google.com, joonas.lahtinen@linux.intel.com, linux-pci@vger.kernel.org, maarten.lankhorst@linux.intel.com, matthew.auld@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, thomas.lendacky@amd.com, quic_qiancai@quicinc.com Subject: Re: [PATCH v15 00/12] Restricted DMA Message-ID: <20210625123004.GA3170@willie-the-truck> References: <20210624155526.2775863-1-tientzu@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 03:19:48PM -0400, Konrad Rzeszutek Wilk wrote: > On Thu, Jun 24, 2021 at 11:55:14PM +0800, Claire Chang wrote: > > This series implements mitigations for lack of DMA access control on > > systems without an IOMMU, which could result in the DMA accessing the > > system memory at unexpected times and/or unexpected addresses, possibly > > leading to data leakage or corruption. > > > > For example, we plan to use the PCI-e bus for Wi-Fi and that PCI-e bus is > > not behind an IOMMU. As PCI-e, by design, gives the device full access to > > system memory, a vulnerability in the Wi-Fi firmware could easily escalate > > to a full system exploit (remote wifi exploits: [1a], [1b] that shows a > > full chain of exploits; [2], [3]). > > > > To mitigate the security concerns, we introduce restricted DMA. Restricted > > DMA utilizes the existing swiotlb to bounce streaming DMA in and out of a > > specially allocated region and does memory allocation from the same region. > > The feature on its own provides a basic level of protection against the DMA > > overwriting buffer contents at unexpected times. However, to protect > > against general data leakage and system memory corruption, the system needs > > to provide a way to restrict the DMA to a predefined memory region (this is > > usually done at firmware level, e.g. MPU in ATF on some ARM platforms [4]). > > > > [1a] https://googleprojectzero.blogspot.com/2017/04/over-air-exploiting-broadcoms-wi-fi_4.html > > [1b] https://googleprojectzero.blogspot.com/2017/04/over-air-exploiting-broadcoms-wi-fi_11.html > > [2] https://blade.tencent.com/en/advisories/qualpwn/ > > [3] https://www.bleepingcomputer.com/news/security/vulnerabilities-found-in-highly-popular-firmware-for-wifi-chips/ > > [4] https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/mediatek/mt8183/drivers/emi_mpu/emi_mpu.c#L132 > > > > v15: > > - Apply Will's diff (https://lore.kernel.org/patchwork/patch/1448957/#1647521) > > to fix the crash reported by Qian. > > - Add Stefano's Acked-by tag for patch 01/12 from v14 > > That all should be now be on > > https://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git/ > devel/for-linus-5.14 (and linux-next) Thanks Konrad! Will