From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [RFC][PATCH] get rid of the use of set_fs() (by way of kernel_recvmsg()) in sunrpc Date: Thu, 18 Jan 2018 08:29:57 -0800 Message-ID: <20180118162957.GA16649@infradead.org> 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 Return-path: Content-Disposition: inline In-Reply-To: <20180118044302.GZ13338@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org To: Al Viro 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 List-Id: linux-arch.vger.kernel.org > 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. Same for ioctl so that we can pass properly typed kernel or user buffers through without all these set_fs hacks. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:58649 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755160AbeARQaF (ORCPT ); Thu, 18 Jan 2018 11:30:05 -0500 Date: Thu, 18 Jan 2018 08:29:57 -0800 From: Christoph Hellwig Subject: Re: [RFC][PATCH] get rid of the use of set_fs() (by way of kernel_recvmsg()) in sunrpc Message-ID: <20180118162957.GA16649@infradead.org> 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> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Al Viro 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 Message-ID: <20180118162957.ekxlR8LJMe5lsGhpRG7vGh7z9HQCAiZvneihHuYkXNY@z> > 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. Same for ioctl so that we can pass properly typed kernel or user buffers through without all these set_fs hacks.