From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] tcp/dccp: fix lockdep issue when SYN is backlogged Date: Mon, 01 Oct 2018 15:43:08 -0700 (PDT) Message-ID: <20181001.154308.1092275550794942572.davem@davemloft.net> References: <20181001220226.252453-1-edumazet@google.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com To: edumazet@google.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:33594 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbeJBFXL (ORCPT ); Tue, 2 Oct 2018 01:23:11 -0400 In-Reply-To: <20181001220226.252453-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Date: Mon, 1 Oct 2018 15:02:26 -0700 > In normal SYN processing, packets are handled without listener > lock and in RCU protected ingress path. > > But syzkaller is known to be able to trick us and SYN > packets might be processed in process context, after being > queued into socket backlog. > > In commit 06f877d613be ("tcp/dccp: fix other lockdep splats > accessing ireq_opt") I made a very stupid fix, that happened > to work mostly because of the regular path being RCU protected. > > Really the thing protecting ireq->ireq_opt is RCU read lock, > and the pseudo request refcnt is not relevant. > > This patch extends what I did in commit 449809a66c1d ("tcp/dccp: > block BH for SYN processing") by adding an extra rcu_read_{lock|unlock} > pair in the paths that might be taken when processing SYN from > socket backlog (thus possibly in process context) > > Fixes: 06f877d613be ("tcp/dccp: fix other lockdep splats accessing ireq_opt") > Signed-off-by: Eric Dumazet > Reported-by: syzbot Applied and queued up for -stable, thanks Eric.