From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBothRQx4urHVsfVY9cK0kTfPq3x62MSyLBj52fKX1OesFhcFE+OxwS59bO3CNI440lYsswVv ARC-Seal: i=1; a=rsa-sha256; t=1516303929; cv=none; d=google.com; s=arc-20160816; b=qszuG9TKLtFjKPhN7bJYCNfufyZie+3UyLuPrkb418hZgyEy4bN7ji6AxD5zu7hoIn TzvOChlXjwcMVWgvgV+6njTh6X4x3slzuIej7E6q5bLBh6G9dgf8cETym2enKBdgl21u W+ozgHVEJWSenOf+1sFmYqmQ6ncASGFmhjDiY9Swv2dRCtIiyvIM4lhvD7R8j8594TLw dXxtcH2oqClQn4vPhJaT3LpO+L54PoMqK3DxptKmuBGyuHy4WsKjxsfIU8wXe8EolW2L bI1wqcSi1oQWwS9e0znzg8Q+JPKOwSfsU+xQNgP+EH0LSkize7l4ZBcxCroYZHF5RZXJ /fKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=b5HihPgwGbnt3LxRXNu/LIsKYdEZc2hB2vx4FEcuHkVZRVoyf/Qhfo4TlPSTAEfnH5 Zo393wQaPOQD6ojrnrIsqF5wwLjctkfNEjy9i10gHLarKxr4CNv6WJoHB+uTV1xqPGj8 lKQTLa+0HvfrWXudA+l7yyOLXZRxJ/7LmHqqhhubP603nsn7WX3a/2juYadtgueO2jVZ d1zoQ15y1CaFH0XoMQ+4S546qD3OyT8Auj5gqcQGnebSeoitQNTaMwG+MTv87DjJURNl N8ZozUL2R3OhGixxbvSA5heOJ3haIiSQ96Qpm6v2XrSUYq9pMwls1LM2wtWDccMuW2rm IAlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of viro@ftp.linux.org.uk designates 195.92.253.2 as permitted sender) smtp.mailfrom=viro@ftp.linux.org.uk Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of viro@ftp.linux.org.uk designates 195.92.253.2 as permitted sender) smtp.mailfrom=viro@ftp.linux.org.uk 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: Al Viro X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589897919168956864?= X-GMAIL-MSGID: =?utf-8?q?1589959907997598535?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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