Received: by 10.223.148.5 with SMTP id 5csp7947203wrq; Thu, 18 Jan 2018 11:33:01 -0800 (PST) X-Google-Smtp-Source: ACJfBotc21iL6nZfMojECRc9MJnN+l+NfDDSmtEG74KkMKlPOfFuKBVvQGqKJYyikaCPPEYqjmkQ X-Received: by 10.99.65.70 with SMTP id o67mr38619587pga.125.1516303981164; Thu, 18 Jan 2018 11:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516303981; cv=none; d=google.com; s=arc-20160816; b=T81uW/lj+Y6O/o9e2HqgMOprValprBlmdEgQR/N0ICPXA3oUCAwnG5n5p57xPFvQyt EceZQca+5kV9NF3KDQxAgECzUNwFvAhn5/iy7O12HGvovs9CFhUZOdnilEoer0JbzvtS VjHqiz8xcelxMVN+qnE3xY8fXpjrnlPC8SUBxy+MWIHc3EgiHyKHT77ID+3VfHGmpW0i bMlCmSCAF1E2D1z1hR7QRC2UOzU6DD2jFJ9t+Di3xDVa2WF55msyvqh+mARI/5mgH1rv 8vWBYk80T5WmdG0UcbOlI4m4R7oE4W0e8QTqWPeSsMNCjHS1qrK+8I914M7wLweDVya1 H1tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=UJpf4VlYIos6rtiujAaVuvF0HYokbK/KtMVzX0DSS4g=; b=OXko5KBCYs0MHh+UWKT3IVihgKTYCgr2PE23ueeXhXXEwRKT3A4+FP2LGELhtQfeas XPESWboR7wns5SGCvVOIF3ypsALmgKwCrdXD/NBig75tXzSy5nxs2O+6me3al0hKdDsa KASuMNFYKjUbwcuUb4gTY4iVbil0dAlefVTkSwv6p/zEaOWOwzm9s6zLWsVZkHbZDNq9 VHbUvhcqf25Ns/AIsdxDZLJ2uwTpR2cOnjarNSzYbMBZJKJ+aJQfW/spk0bxne2HsMVw 2YNrqIWPDbWx61LBcmCHTuGkA4x3Kj45L6XRyGqcpKFNn55nkJDi9ehUOlM/TWSYmhrE PnSA== 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 l13si6891686pgc.833.2018.01.18.11.32.46; Thu, 18 Jan 2018 11:33:01 -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 S932384AbeARTcK (ORCPT + 99 others); Thu, 18 Jan 2018 14:32:10 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:55432 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755033AbeARTcI (ORCPT ); Thu, 18 Jan 2018 14:32:08 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1ecFun-0004x5-0F; Thu, 18 Jan 2018 19:31:57 +0000 Date: Thu, 18 Jan 2018 19:31:56 +0000 From: Al Viro To: Linus Torvalds Cc: Network Development , Dan Williams , Linux Kernel Mailing List , linux-arch@vger.kernel.org, Andi Kleen , Kees Cook , kernel-hardening@lists.openwall.com, Greg Kroah-Hartman , the arch/x86 maintainers , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , Alan Cox , David Miller Subject: Re: [RFC][PATCH] get rid of the use of set_fs() (by way of kernel_recvmsg()) in sunrpc Message-ID: <20180118193156.GC13338@ZenIV.linux.org.uk> References: <1516198646.4184.13.camel@linux.intel.com> <20180117185232.GW13338@ZenIV.linux.org.uk> <20180118030634.GY13338@ZenIV.linux.org.uk> <20180118044302.GZ13338@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180118044302.GZ13338@ZenIV.linux.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 18, 2018 at 04:43:02AM +0000, Al Viro wrote: > We could turn ->msg_control/->msg_controllen into another > iov_iter, but seeing that we never do scatter-gather for those > IMO that would be a massive overkill. A flag controlling whether > ->msg_control is kernel or userland pointer would do, especially > since we already have a flag for "do we want a native or compat > layout for cmsg" in there. > > That's the only caller we need it for, but that thing looks cheap > enough. Obviously needs to pass testing, including "is it too ugly to > live as far as Davem is concerned" test, though... BTW, there's another series of set_fs-removal patches in net ioctls; still needs review, though. With that one we would be down to 11 instances in the entire net/*: * SO_RCVTIMEO/SO_SNDTIMEO handling in compat [sg]etsockopt() * passing SIOC{ADD,DEL}TUNNEL down (ipmr_del_tunnel(),ipmr_new_tunnel(), addrconf_set_dstaddr()) * SIOCGSTAMP/SIOCGSTAMPNS in compat ioctls * SIOCADDRT/SIOCDELRT in compat ioctls * kernel_[gs]etsockopt() * ipv6_renew_options_kern() I don't know if all of that stuff can be realistically done without set_fs(). kernel_setsockopt(), in particular, is unpleasant... The patches need review and testing, obviously; I'll post them in followups, the entire series (on top of net/master) is in git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #work.net-ioctl