Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp732596ybl; Wed, 29 Jan 2020 08:45:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxRus6kL+ZPIztzbv1OJa1Jak+rnevXl+vbEAvysVUrrGkzIhjBKZXRYhOdgUiEn/Zqi7xV X-Received: by 2002:a05:6830:15c2:: with SMTP id j2mr73077otr.351.1580316329858; Wed, 29 Jan 2020 08:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580316329; cv=none; d=google.com; s=arc-20160816; b=baCZOS1dwRoLDMeuA+412ixIPnBfSb4/DTQTSi4bf5zXrquQQKkQ2ceieyRdbQJ38d Tajr/LwvKNBDZxqaKI3/e7hIYp73VyWfYgsvHdVw2qH7J4fXfx8Ykp3jz5as36y1PKdH 2SFvMsWNE0qjzGJ5svcElaEywbRq839p25ZOCk+o5OkHKY4orOyIQAzDmBcEUE/zGUHp ZB7pgAOtvoAwUiuB8vKlfMBSpHJNKmWW+xuIa47ktF5xLQgpmGZtAEeRBRIf6F7uoWIx FaldDl5zAmeeKc98yXF1ffZAaIfn7onLZgVGvqYui4TtPicnsQyLKx4g1h3zC+4fG7b/ WAoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Xp0DlMPjZlagCGs07mHZ//hKj78+N84XXBbgsTH/wRQ=; b=GzLfwRfqBEjyCoeNmDlopxUeWbaZVzb8Db1iGAPrdzqiX5Sp+qno95LXnnLi3tygws joeSsjSLRR6n40rRX7D/bf8aKiv3rVujlmR6kXIEOuQwj07wjTq6uAlTAuUcQesoRhgs rg1VuBF0jIMjFAwxfvTdaNboPJLZPAaq3v/l07AkZpjq6M9P97CdeFvFH9DbSeE3Sx3J IgFZ5d0kWzRpJO1v882FHUxDe7icAXfDvMynT2yWJoKGrNCYH7DfopnT4G9mZExjlG8/ CR9vIrmmF1AdYiSgntXjdLAOfqPa42WqjBqPm5KvR47ID/zYDFIgZSuXZwwDhW5TEcej On8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si1311843otp.236.2020.01.29.08.45.17; Wed, 29 Jan 2020 08:45:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbgA2Qnb (ORCPT + 99 others); Wed, 29 Jan 2020 11:43:31 -0500 Received: from gentwo.org ([3.19.106.255]:40906 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgA2Qnb (ORCPT ); Wed, 29 Jan 2020 11:43:31 -0500 Received: by gentwo.org (Postfix, from userid 1002) id 275353FFFA; Wed, 29 Jan 2020 16:43:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 254433F070; Wed, 29 Jan 2020 16:43:30 +0000 (UTC) Date: Wed, 29 Jan 2020 16:43:30 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Kees Cook cc: Christian Borntraeger , Jiri Slaby , Julian Wiedmann , Ursula Braun , Alexander Viro , linux-kernel@vger.kernel.org, David Windsor , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-xfs@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Christoph Hellwig , "David S. Miller" , Laura Abbott , Mark Rutland , "Martin K. Petersen" , Paolo Bonzini , Christoffer Dall , Dave Kleikamp , Jan Kara , Luis de Bethencourt , Marc Zyngier , Rik van Riel , Matthew Garrett , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, kernel-hardening@lists.openwall.com, Vlastimil Babka , Michal Kubecek Subject: Re: [kernel-hardening] [PATCH 09/38] usercopy: Mark kmalloc caches as usercopy caches In-Reply-To: <202001281457.FA11CC313A@keescook> Message-ID: References: <1515636190-24061-1-git-send-email-keescook@chromium.org> <1515636190-24061-10-git-send-email-keescook@chromium.org> <9519edb7-456a-a2fa-659e-3e5a1ff89466@suse.cz> <201911121313.1097D6EE@keescook> <201911141327.4DE6510@keescook> <202001271519.AA6ADEACF0@keescook> <5861936c-1fe1-4c44-d012-26efa0c8b6e7@de.ibm.com> <202001281457.FA11CC313A@keescook> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Jan 2020, Kees Cook wrote: > > On the other hand not marking the DMA caches still seems questionable. > > My understanding is that exposing DMA memory to userspace copies can > lead to unexpected results, especially for misbehaving hardware, so I'm > not convinced this is a generically bad hardening choice. "DMA" memory (and thus DMA caches) have nothing to do with DMA. Its a legacy term. "DMA Memory" is memory limited to a certain physical address boundary (old restrictions on certain devices only supporting a limited number of address bits). DMA can be done to NORMAL memory as well.