From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net_sched: gen_estimator: fix lockdep splat Date: Mon, 29 Jan 2018 14:31:08 -0500 (EST) Message-ID: <20180129.143108.1563505447234447053.davem@davemloft.net> References: <1517079523.3715.73.camel@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us To: eric.dumazet@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:48706 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbeA2TbK (ORCPT ); Mon, 29 Jan 2018 14:31:10 -0500 In-Reply-To: <1517079523.3715.73.camel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Date: Sat, 27 Jan 2018 10:58:43 -0800 > From: Eric Dumazet > > syzbot reported a lockdep splat in gen_new_estimator() / > est_fetch_counters() when attempting to lock est->stats_lock. > > Since est_fetch_counters() is called from BH context from timer > interrupt, we need to block BH as well when calling it from process > context. > > Most qdiscs use per cpu counters and are immune to the problem, > but net/sched/act_api.c and net/netfilter/xt_RATEEST.c are using > a spinlock to protect their data. They both call gen_new_estimator() > while object is created and not yet alive, so this bug could > not trigger a deadlock, only a lockdep splat. > > Fixes: 1c0d32fde5bd ("net_sched: gen_estimator: complete rewrite of rate estimators") > Signed-off-by: Eric Dumazet > Reported-by: syzbot Applied, thanks.