Return-Path: Date: Fri, 7 Aug 2020 09:21:20 +0200 From: Christoph Hellwig Message-ID: <20200807072120.GB2086@lst.de> References: <20200723060908.50081-1-hch@lst.de> <20200723060908.50081-26-hch@lst.de> <6357942b-0b6e-1901-7dce-e308c9fac347@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6357942b-0b6e-1901-7dce-e308c9fac347@gmail.com> Subject: Re: [Bridge] [PATCH 25/26] net: pass a sockptr_t into ->setsockopt List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Dumazet Cc: Alexei Starovoitov , linux-sctp@vger.kernel.org, Christoph Hellwig , Stefan Schmidt , linux-s390@vger.kernel.org, rds-devel@oss.oracle.com, Daniel Borkmann , dccp@vger.kernel.org, bridge@lists.linux-foundation.org, linux-afs@lists.infradead.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 Thu, Aug 06, 2020 at 03:21:25PM -0700, Eric Dumazet wrote: > converting get_user(...) to copy_from_sockptr(...) really assumed the optlen > has been validated to be >= sizeof(int) earlier. > > Which is not always the case, for example here. Yes. And besides the bpfilter mess the main reason I even had to add the sockptr vs just copying optlen in the high-level socket code. Please take a look at the patch in the other thread to just revert to the "dumb" version everywhere.