Received: by 10.223.148.5 with SMTP id 5csp8025572wrq; Thu, 18 Jan 2018 12:35:55 -0800 (PST) X-Google-Smtp-Source: ACJfBos59siQ3zLy6gW/HO/Vf1/OcQY3QTniiya/m3dJnonVbLgotcA08a2OxxYYlVz5gBX8qzTR X-Received: by 2002:a17:902:678b:: with SMTP id g11-v6mr380969plk.13.1516307755434; Thu, 18 Jan 2018 12:35:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516307755; cv=none; d=google.com; s=arc-20160816; b=ma/l5P1PhXDOg89MXk8p7p+sxhSDTdyC3/+WiDdro1ZJAao1E5D47bfSUAyC41LfNV q/9GsKGs3tgwz4i0lBbDeD04gXN4ryjYtSVhXGwVpodbn6hZ65v2CmzX/U+6zFoQnpXH VNIND5M9AgAQsRQP81ncZNPG0DgYavVE5RACvk3+lsJLjXSaTAihIdGSnj/2wpLpeR/A Zcze2GvyTHHuglaUYxr9HqeQK4Qv+COIA41Qi/NuDhRlscazHy/gEjHVlPGFsiq6CTaM Kcl0FLKoNJ6e2nJa0AhqpPU8Gw0MBC3r2a3BiZCeVZvDSOWgHKILW0aqB/1vc01rekor HDUA== 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=OihYe7u4EWCKpncNXm7GJ3QsY/O40iXfpY1RSJVtOQw=; b=m7eEd5HFcfIxx8dgjq+QqpRqoZLG9lDVVeykUbActoGcxG/vcdO2BgQZfmercL7G4N wMbaBMp7+QFcRJnWa7WVCGMY7vVB5RSqCMPJGfMeitzh8Su8t2XGFCxh0UIfcQ75gbQZ zieyKISq/T9apv5sjbJjUDkBWAkR/Rbw0kGUOtPcXT7yf1fAucK6reE0EQgAlBmQhDtI N3rhnclfGnV8A3u5iMd2lUP7uZui85/wSnvg6UNNPzO+b/5pad0LmBt//7TjOCRXPeXO aRRCLOv9/62FKIiV2BYAhNbLhVENC/2fV3u7TaKBARTrJsaDo7DbZQvlY0ljhikdroxO dPJw== 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 r29si7632951pfj.115.2018.01.18.12.35.40; Thu, 18 Jan 2018 12:35:55 -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 S932888AbeARUd5 (ORCPT + 99 others); Thu, 18 Jan 2018 15:33:57 -0500 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 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1ecGsa-0007Ej-69; Thu, 18 Jan 2018 20:33:44 +0000 Date: Thu, 18 Jan 2018 20:33:44 +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: <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 Content-Disposition: inline In-Reply-To: <20180118193156.GC13338@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 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()?