From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net: remove hlist_nulls_add_tail_rcu() Date: Tue, 05 Dec 2017 18:07:26 -0500 (EST) Message-ID: <20171205.180726.1564033390463106515.davem@davemloft.net> References: <1512506756.25033.4.camel@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: kraigatgoog@gmail.com, edumazet@google.com, glider@google.com, netdev@vger.kernel.org To: eric.dumazet@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:42030 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbdLEXH1 (ORCPT ); Tue, 5 Dec 2017 18:07:27 -0500 In-Reply-To: <1512506756.25033.4.camel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Date: Tue, 05 Dec 2017 12:45:56 -0800 > From: Eric Dumazet > > Alexander Potapenko reported use of uninitialized memory [1] > > This happens when inserting a request socket into TCP ehash, > in __sk_nulls_add_node_rcu(), since sk_reuseport is not initialized. > > Bug was added by commit d894ba18d4e4 ("soreuseport: fix ordering for > mixed v4/v6 sockets") > > Note that d296ba60d8e2 ("soreuseport: Resolve merge conflict for v4/v6 > ordering fix") missed the opportunity to get rid of > hlist_nulls_add_tail_rcu() : > > Both UDP sockets and TCP/DCCP listeners no longer use > __sk_nulls_add_node_rcu() for their hash insertion. > > Since all other sockets have unique 4-tuple, the reuseport status > has no special meaning, so we can always use hlist_nulls_add_head_rcu() > for them and save few cycles/instructions. > > [1] ... > Fixes: d894ba18d4e4 ("soreuseport: fix ordering for mixed v4/v6 sockets") > Fixes: d296ba60d8e2 ("soreuseport: Resolve merge conflict for v4/v6 ordering fix") > Signed-off-by: Eric Dumazet > Reported-by: Alexander Potapenko > Acked-by: Craig Gallek I was just talking with Craig and Willem about this change the other day, what a coincidence :-) Applied and queued up for -stable, thanks Eric.