Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4029999ybl; Mon, 3 Feb 2020 11:10:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyAt5ijiV+O74+NJQQ/ZblbltEpFDLgDHTqr1A21yYXtIW8Z91ZhjSpDG+sP73tSGwN/0w1 X-Received: by 2002:a9d:6e02:: with SMTP id e2mr19057336otr.194.1580757011304; Mon, 03 Feb 2020 11:10:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757011; cv=none; d=google.com; s=arc-20160816; b=AqWsNnpuw/wSR6/nV/IgrgEMXUBFVyDcYrJbyeVtgLVd9S7cMmMbiGvIX5xNQnYrPb x5Yd6RF415g8cEjinHJjXNbqCVEhAa62Fzdu6BcWH6co2TBCkv8oJevWX84/ZPKTAl6h zGJBAX8cORYSD/GuokHRD5Se789h81S1PSmbn5qMGX4Y5BHFSV4T6cmp3Gedw+sx4Id9 IjLXs7Nm9JU4eeNOjXqvPYkXHiIPC4AW7wn5ZovF8amrmMdxGd+NIMjCjIPDQAJzcNyD 9c/xkSFNumPAQPEDkcqBvG114fsPki0wAw1ZZSW4ksK1vn3JHJZUrhcSTp0p5jPaMtYS CBqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=M5ilNMr/HaOIF+l97HNJx/b4/Xm/SDuNMftzBAjQyhk=; b=JFnR9hlhcjp1asD5+uKCW2TojRXNHAbHrhPgb0FhIHyCVQZ3VYfGGlcoPsGj3nu8+S z1X340GmMdWSUUBPMM1YKgNmwaeL1zXFktpFGvLwBLE36cvNoeEPAsHfAUH5y7iHDM3h NifKD3YvtmJbESxpVGRmJGFaKlbMN1lt7GdAWyH8ikuOnDUELlE3qu3OAegci6soCZ0W 5+nvW2xxhf204bldKguV+6NrDDyy/4nJ16jVD3KNXCzDsLuPRSkUfCdQ7C5SljehNw6P puqxwNxv3x5w557+JHhLcqNkwMnUc36ssz+W/A1ztrMCXhlNTrRULyDSY7+riAgk5FXy a86A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aRscgIH2; 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 m14si9557616otr.131.2020.02.03.11.09.59; Mon, 03 Feb 2020 11:10:11 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aRscgIH2; 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 S1728814AbgBCRgf (ORCPT + 98 others); Mon, 3 Feb 2020 12:36:35 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48756 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbgBCRge (ORCPT ); Mon, 3 Feb 2020 12:36:34 -0500 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.