Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de526f40 authored by Eric Dumazet's avatar Eric Dumazet Committed by Pablo Neira Ayuso
Browse files

netfilter: xt_hashlimit: fix lock imbalance



syszkaller found that rcu was not held in hashlimit_mt_common()

We only need to enable BH at this point.

Fixes: bea74641 ("netfilter: xt_hashlimit: add rate match mode")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent db57ccf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -775,7 +775,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;