From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBosYrVTrc+OsDJVoRrsSU48kK6HUpyU8+83Amgqi7MoazSgVY+E1S7O2bZMdXztgajyPov9B ARC-Seal: i=1; a=rsa-sha256; t=1516295432; cv=none; d=google.com; s=arc-20160816; b=RtrqEssBm+eZAg4aLp9TsigXR573mBKAp/xTNnqirncvpOTK3qdlVJtMdC3Jd2U/B9 YYmedEuUtQSBq5Tqfeu1DdQxulMrqjYjd6hTymRU1YXpQNLC+J+Umv/zH1ZrjvTIBhHq 8+4s37i4ZDI5wi5gT0f1Aluvl0+hNr9SGTeEf/I9Y0Fb+CpUwBS9I8fBIeBt1UuxlmbN 3JTszUarMNDGGYEOPHQNWyO29V+ffWRy86Jxng7BzxcsvZf9uGbteSfX/TQ1UK+ebtj5 EKTIc8jO2X1rTbq0P60cLotFTsL8Q1QN56tQbmPnbPjwfcHu7PiA8tgHHbLF0wIjobxD eFDg== 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=Y/mwm8XZ8ZS3Jo/wzYZQFThpqPuCmdoXCRNwYaWcdy0=; b=bUscY4VSld71X3BPjAnrlloik5GbeXknbSRda1NjXeGLPkyCn6ILd/Fg0ryA8P4uDp NKhvDj8f5mh5KhMySRBRC7oauNbzYrUJhqnUdPofX9KbhoVxt3t72+DCdIdRZXUssI/3 U+KSnJL+O8W5aaC8kmxtVuJSZPHtU0Hu41BsZntGZDceGfH5frOWvFI7wt4w9tQTMzhk XS8Q1yAjD4AySpkZJ7mE/QODkd8o8Q0OEWfX91pv0xlk8P+TpTKXZtP37dtaJxKo0U3l 8WZ/Phfa8G7u5hCQolOwYRV1Had3aRDR1Hp6XNiZHesATlzbfJCXSkdpfeDNn0OYmEVT DzuQ== 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 17:10:20 +0000 From: Al Viro To: Christoph Hellwig Cc: Linus Torvalds , 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: <20180118171020.GA13338@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> <20180118162957.GA16649@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180118162957.GA16649@infradead.org> 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?1589950998707071514?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Thu, Jan 18, 2018 at 08:29:57AM -0800, Christoph Hellwig 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. > > While your current hack seems like a nice short term improvement > I think we need an iov_iter or iov_iter-light there in the long run. For one caller in the entire history of the kernel? > Same for ioctl so that we can pass properly typed kernel or user > buffers through without all these set_fs hacks. Umm... Most of the PITA with ioctls is due to compat ones being reformatted for native and fed under set_fs(). I actually have a series dealing with most of such places for net ioctls. Sure, there's also ioctl_by_bdev(), but for those we might be better off exposing the things like ->get_last_session() and its ilk to filesystems that want to deal with cdroms... It's kernel_setsockopt() that is the real PITA...