From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595263119; bh=wlqo7kAx+og7PtKyjy/9X5uYlujAIR96QYTi8/c6yXY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KedFP10soudJd9FGCXk2UQ6mwGYV9FfLgr9Jehpfqo3DeBMYh9Cg2T64ka4vLb/9E yZE0kTEtUh1mwFGolpaTN3qJTAigCNeN60HjhesQSQimi39aadhKkQmY9ZpzWdIGAc DM8CICk2pF95QKtAIcFlAv4SRPp0hIAXO+8S+9xE= Date: Mon, 20 Jul 2020 09:38:36 -0700 From: Eric Biggers Message-ID: <20200720163836.GB1292162@gmail.com> References: <20200720124737.118617-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200720124737.118617-1-hch@lst.de> Subject: Re: [Bridge] get rid of the address_space override in setsockopt List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Alexei Starovoitov , linux-sctp@vger.kernel.org, linux-afs@lists.infradead.org, linux-s390@vger.kernel.org, rds-devel@oss.oracle.com, Daniel Borkmann , dccp@vger.kernel.org, bridge@lists.linux-foundation.org, lvs-devel@vger.kernel.org, coreteam@netfilter.org, mptcp@lists.01.org, Alexey Kuznetsov , linux-can@vger.kernel.org, Jakub Kicinski , linux-hams@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-x25@vger.kernel.org, Eric Dumazet , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-decnet-user@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-crypto@vger.kernel.org, bpf@vger.kernel.org, linux-wpan@vger.kernel.org, "David S. Miller" On Mon, Jul 20, 2020 at 02:47:13PM +0200, Christoph Hellwig wrote: > Hi Dave, > > setsockopt is the last place in architecture-independ code that still > uses set_fs to force the uaccess routines to operate on kernel pointers. > > This series adds a new sockptr_t type that can contained either a kernel > or user pointer, and which has accessors that do the right thing, and > then uses it for setsockopt, starting by refactoring some low-level > helpers and moving them over to it before finally doing the main > setsockopt method. > > Note that I could not get the eBPF selftests to work, so this has been > tested with a testing patch that always copies the data first and passes > a kernel pointer. This is something that works for most common sockopts > (and is something that the ePBF support relies on), but unfortunately > in various corner cases we either don't use the passed in length, or in > one case actually copy data back from setsockopt, so we unfortunately > can't just always do the copy in the highlevel code, which would have > been much nicer. > Please mention what git tree your patchset applies to. - Eric