From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net] netfilter: xt_hashlimit: fix lock imbalance Date: Mon, 12 Feb 2018 08:11:48 -0800 Message-ID: <1518451908.3715.161.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: Vishwanath Pai , netdev To: Pablo Neira Ayuso , Florian Westphal Return-path: Received: from mail-qt0-f195.google.com ([209.85.216.195]:33844 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934432AbeBLQLz (ORCPT ); Mon, 12 Feb 2018 11:11:55 -0500 Received: by mail-qt0-f195.google.com with SMTP id d14so184922qtg.1 for ; Mon, 12 Feb 2018 08:11:54 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet syszkaller found that rcu was not held in hashlimit_mt_common() We only need to enable BH at this point. Fixes: bea74641e378 ("netfilter: xt_hashlimit: add rate match mode") Signed-off-by: Eric Dumazet Reported-by: syzkaller ---  net/netfilter/xt_hashlimit.c |    2 +-  1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index ca6847403ca218c478d208080aab3e3c92a0a615..1fea48b4182f7cd5669b9c5e7100b2735cc590e7 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -774,7 +774,7 @@ hashlimit_mt_common(const struct sk_buff *skb, struct xt_action_param *par, if (!dh->rateinfo.prev_window && (dh->rateinfo.current_rate <= dh->rateinfo.burst)) { spin_unlock(&dh->lock); - rcu_read_unlock_bh(); + local_bh_enable(); return !(cfg->mode & XT_HASHLIMIT_INVERT); } else { goto overlimit;