From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [RFC][PATCH] get rid of the use of set_fs() (by way of kernel_recvmsg()) in sunrpc Date: Thu, 18 Jan 2018 20:33:44 +0000 Message-ID: <20180118203343.GD13338@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> <20180118193156.GC13338@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:57068 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932322AbeARUd4 (ORCPT ); Thu, 18 Jan 2018 15:33:56 -0500 Content-Disposition: inline In-Reply-To: <20180118193156.GC13338@ZenIV.linux.org.uk> Sender: linux-arch-owner@vger.kernel.org List-ID: 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 On Thu, Jan 18, 2018 at 07:31:56PM +0000, Al Viro wrote: > * 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... Speaking of weird indirect calls: in net/packet/af_packet.c:packet_ioctl() we have this: #ifdef CONFIG_INET case SIOCADDRT: case SIOCDELRT: case SIOCDARP: case SIOCGARP: case SIOCSARP: case SIOCGIFADDR: case SIOCSIFADDR: case SIOCGIFBRDADDR: case SIOCSIFBRDADDR: case SIOCGIFNETMASK: case SIOCSIFNETMASK: case SIOCGIFDSTADDR: case SIOCSIFDSTADDR: case SIOCSIFFLAGS: return inet_dgram_ops.ioctl(sock, cmd, arg); #endif That's inet_ioctl(sock, cmd, arg) disguised by indirect. AFAICS, that line dates back to 2.1.89; back then inet_dgram_ops had been exported and inet_ioctl() had been static. When SCTP went in they'd exported inet_ioctl() rather than playing that kind of games. Is there anything subtle I'm missing here that would make it wrong to replace that with explicit call of inet_ioctl()?