]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: xt_hashlimit: reduce hashlimit_mutex scope for htable_put()
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 3 Feb 2020 04:30:52 +0000 (20:30 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 7 Feb 2020 14:53:31 +0000 (15:53 +0100)
commita961f83e490aac7bf8e83054305042185cdcc676
treebfb9ea05404c15a28bb5cd556bb24bd79b665341
parentc933c099aa5b9b5ee77479eb0015f4ff9974f7a1
netfilter: xt_hashlimit: reduce hashlimit_mutex scope for htable_put()

It is unnecessary to hold hashlimit_mutex for htable_destroy()
as it is already removed from the global hashtable and its
refcount is already zero.

Also, switch hinfo->use to refcount_t so that we don't have
to hold the mutex until it reaches zero in htable_put().

Reported-and-tested-by: syzbot+adf6c6c2be1c3a718121@syzkaller.appspotmail.com
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_hashlimit.c