From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBovPe2tm0VW2w8lz/PxOSgD2QtwtfY5cu1v7eb6SbnGjIrmnAurvmtnZcDJgu6UmMgeqR6v5 ARC-Seal: i=1; a=rsa-sha256; t=1516307637; cv=none; d=google.com; s=arc-20160816; b=0s0EcRWc+G/N8i+gWTGlRdolYLso2smK/Nu0yrd7FC22PyxC4xWQPWMSFhH1AKeJHB amz/nD2EGUjz6GJUxMJxkAKSw0D1jX9PNDcjUfMPsyJWLF6+UMnXMM3j9ufWIt68ST8j OY0AfhHmI79yBRna7HI5PPxR0fEDjkckNxdUbvQdm0q40I5e20AevGbKUoxVRVDqwvaH 8vnCDE69D3dElYywPVI/jbIBhnEIJ9jC9mFczPEQNzn2PU+hiKu5//9O17V4XlhOlEKU RUoQ6/pRdaR86H1E07kFfqd1mUxCnh5FvKmY8XDPssRmIzN8qaATQA5FgPD2p988ccUR eQ1A== 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=OihYe7u4EWCKpncNXm7GJ3QsY/O40iXfpY1RSJVtOQw=; b=SauwhQMcVDayNoLz8W5CGK3fLfAMEthse/LNBuvex7mABxtcyVYqhMAFjYUGdtE1rj QbQXSQt4r5IFgYr8Os2LdjNnsX/1ZmKgplGkSfP6zgu9zeDl5RAmkBTp4n5ZRHWeHB5e 0PZnwJbZYxGbpITo1hTdKUQJ2hyyW/uwBGDdnJpoSMQuKatLR3W22hD/32ZKUGX9QG4+ G6HXIihZjcUW6hvDRnPYUi7uZsbBji7mImU9fs7H9fK7egn9CFLs7IIF6xmjdOZsP2l1 Q6jCgZXeVO9OXucPn/uk+3JAoEMMhndmj7jaKDt3AzgH7KRJppGYe+rGbbvpQt7hFd1e Iz4g== 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 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: Al Viro X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589897919168956864?= X-GMAIL-MSGID: =?utf-8?q?1589963795466598752?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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()?