Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp680006pxv; Thu, 24 Jun 2021 17:44:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOc9t4YfalOzqSeufdyKJgS7I60fyWo6Wlpq7pg7muhOlmQ0B7VUb2R/D07GidMpn9Jkny X-Received: by 2002:a6b:4418:: with SMTP id r24mr6216810ioa.123.1624581864671; Thu, 24 Jun 2021 17:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624581864; cv=none; d=google.com; s=arc-20160816; b=R+QTGMwFMMhLt/gTANErprT/COQ497bO3LuNP6rePDQVvGvZupeICDeE2oVUp7rEpc aDo7Vynsz7sD0gPrWEpIrjZso3MejfNn5f5kJSR+MSLE4sSruyWurYXngFyIG64mLCeg BkrCqDPWFVHl479WDBU1NW/0E1/Rn1KKvepxAG9W2UpPbr0N7c1OWnUnt3jtXzVWaNWD oLaE3UH07/PPeVm18jA+K+jBesZI/poPi56ds3ycD6bv0ysGu0ILfd5K+CqUrabkTNlC 6ZwELq+mmbysu1Nbxdl5zLSr2nGqzcWC8EZFGCA7POK/ZhdHJ0jWgd0vE0ZfT6fw5/97 zoDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EqlrFHdkETA6GW6RTp23OD25mZ9+t6ZRMvVFoaOPoUc=; b=GjSOBJ+sN0X1MW3kzfJSXsVgd7X1ZoYFvU0iF7uV6zggTJ5+fBCT+0Is1Ry6hrOWIU /nJCA2vK05FLyTjJ0tJ1h8bj2vU06XT0mJGp91aKs8usA2bg0mGKbpyKLhe6VY3aD0Mv eFRzTe8QOtrhVh2TTpd4aMtXXDbLAZ7H7VCN19x2D8//FRDtgI9I16yj7V6GGri+v7EU of0ubdfxd7E+xaxMnemoX0KDgMWYo+ZV6R+8wdT4goPXl7rZYMczeSMTD+N08WdTM0d/ Vmb62v+R6xo4WuVacJpoFsVQ+2IiLlLVJyvCOa+wtEJTbyuCSt8sABs1n2MMjvLnLpqV il7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bWcnQFoa; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si5538671jaj.59.2021.06.24.17.44.10; Thu, 24 Jun 2021 17:44:24 -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=@chromium.org header.s=google header.b=bWcnQFoa; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232906AbhFYAoY (ORCPT + 99 others); Thu, 24 Jun 2021 20:44:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbhFYAoV (ORCPT ); Thu, 24 Jun 2021 20:44:21 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF1BC061756 for ; Thu, 24 Jun 2021 17:42:02 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id k5so8202244ilv.8 for ; Thu, 24 Jun 2021 17:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EqlrFHdkETA6GW6RTp23OD25mZ9+t6ZRMvVFoaOPoUc=; b=bWcnQFoaV8XnWx2CmMqEub8uZpXzFMse4FkKs/6K7fAcmnfM33tj2MQVZVMqk8lHor cnCu5fEy9K2Coqappl8ZOF4ctPyliF3MamPmCDoyKpou7w8OAoAQjHS8393soCVU2vwe MHeea8kRyeqRwy1slhC35EkQWOKLuZs+gqotQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EqlrFHdkETA6GW6RTp23OD25mZ9+t6ZRMvVFoaOPoUc=; b=hBO0D2mU9nPGJD/SxImP/huWgNK4BSkmrkPWjLeSZHQIN4ESxoqvv1aNzwVJn9TpFL pX1jCco3BJtsDHVRMDNP3/umZGnOID+FvzCoaXP3yvReO9mWUORthWR9uE0drbMCZAEP zu/8e/Odi3Ffrf58WkF6yo6QKU5aO6gI9LvpAf/h/GcSd05/qzb279EK5IhQ4tCrftjT t8ueKqc3OnQtm1GOAxlXHxD+/1NZlptejw6dTi36kgjmObyFbJ3XsDMbhhW3BG/pIhXP wbm8KLp7Tsah5af2RMm7lESaZLQsFjyvUmEpr9cHYbfFwLBNVlbdurEU7PZKLVbyfvr1 I/+A== X-Gm-Message-State: AOAM533RI21nfRWdcu6lltpJL7iaQX7MfIob0Fs36iQE8/g0bEnYdKSw BtfBa/AtlVGAr+xvbW6mMUO4Z2mt+cjRKw== X-Received: by 2002:a92:2c02:: with SMTP id t2mr5410165ile.233.1624581720715; Thu, 24 Jun 2021 17:42:00 -0700 (PDT) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com. [209.85.166.52]) by smtp.gmail.com with ESMTPSA id q8sm2378849iot.30.2021.06.24.17.41.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 17:42:00 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id k11so10611295ioa.5 for ; Thu, 24 Jun 2021 17:41:59 -0700 (PDT) X-Received: by 2002:a05:6602:1546:: with SMTP id h6mr6334034iow.34.1624581707960; Thu, 24 Jun 2021 17:41:47 -0700 (PDT) MIME-Version: 1.0 References: <20210624155526.2775863-1-tientzu@chromium.org> In-Reply-To: From: Claire Chang Date: Fri, 25 Jun 2021 08:41:37 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v15 00/12] Restricted DMA To: Konrad Rzeszutek Wilk Cc: Rob Herring , mpe@ellerman.id.au, Joerg Roedel , Will Deacon , 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" , Stefano Stabellini , 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 , Tomasz Figa , bskeggs@redhat.com, Bjorn Helgaas , chris@chris-wilson.co.uk, Daniel Vetter , airlied@linux.ie, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, Jianxiong Gao , 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, Tom Lendacky , Qian Cai Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 3:20 AM 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) > devel/for-linus-5.14 looks good. Thanks!