From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EF76C35247 for ; Mon, 3 Feb 2020 17:36:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC4BF2087E for ; Mon, 3 Feb 2020 17:36:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="aRscgIH2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC4BF2087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 592EC6B0696; Mon, 3 Feb 2020 12:36:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 542946B0697; Mon, 3 Feb 2020 12:36:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 431FC6B0698; Mon, 3 Feb 2020 12:36:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 292996B0696 for ; Mon, 3 Feb 2020 12:36:47 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DC63B2461 for ; Mon, 3 Feb 2020 17:36:46 +0000 (UTC) X-FDA: 76449520812.11.spoon13_3b1e76746f95d X-HE-Tag: spoon13_3b1e76746f95d X-Filterd-Recvd-Size: 4329 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 3 Feb 2020 17:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=M5ilNMr/HaOIF+l97HNJx/b4/Xm/SDuNMftzBAjQyhk=; b=aRscgIH2h0u4Rl1ejEyVb5K5cr UmN9OrjOYROKrgyw8lErle++lCLxJN1Yce9M6aMoTb6vqHWK/H8LiT0lF6w1L6tfCpihErVm1YMDe uFSh3RCwwzsuzL8Tb7xrpDaQY9GpyQjGCW2eZDhtzfIWOJePB3MedA6YJDv2AYc73eNsoZzC7YaKn bjou3GrF54S6T26jlG4BaVI9n22CIcPERlaVrqepPb4ER/SpFuRLtPJ+y0m6Zm8MgBvwEIjEPKV4o ACIsAcGyhfYY7eknHBb4LWnFgLRJf2IrWdsxeTQDhkxsBuHmJurPafJYqIbZsBK5iA7jsrR6PmbtJ sV96kmcg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyfe2-0000sA-OK; Mon, 03 Feb 2020 17:36:22 +0000 Date: Mon, 3 Feb 2020 09:36:22 -0800 From: Christoph Hellwig To: Christian Borntraeger Cc: Christoph Hellwig , Christopher Lameter , Kees Cook , 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 , "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 Message-ID: <20200203173622.GA30011@infradead.org> References: <201911121313.1097D6EE@keescook> <201911141327.4DE6510@keescook> <202001271519.AA6ADEACF0@keescook> <5861936c-1fe1-4c44-d012-26efa0c8b6e7@de.ibm.com> <202001281457.FA11CC313A@keescook> <6844ea47-8e0e-4fb7-d86f-68046995a749@de.ibm.com> <20200129170939.GA4277@infradead.org> <771c5511-c5ab-3dd1-d938-5dbc40396daa@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <771c5511-c5ab-3dd1-d938-5dbc40396daa@de.ibm.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jan 29, 2020 at 06:19:56PM +0100, Christian Borntraeger wrote: > There is not necessarily a device for that. It is a hypervisor interface (an > instruction that is interpreted by z/VM). We do have the netiucv driver that > creates a virtual nic, but there is also AF_IUCV which works without a device. > > But back to the original question: If we mark kmalloc caches as usercopy caches, > we should do the same for DMA kmalloc caches. As outlined by Christoph, this has > nothing to do with device DMA. Oh well, s/390 with its weird mix of cpu and I/O again. Everywhere else where we have addressing limits we do treat that as a DMA address. We've also had a bit of a lose plan to force ZONE_DMA as a public interface out, as it is generally the wrong thing to do for drivers. A ZONE_32 and/or ZONE_31 makes some sense as the backing for the dma allocator, but it mostly shouldn't be exposed, especially not to the slab allocator.