]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 5 Feb 2018 22:41:45 +0000 (14:41 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 6 Feb 2018 23:58:57 +0000 (00:58 +0100)
commit06a74df265e7d1da34c8208eeba2b73d195084e9
treed7ccfe10125fd7b843b55579d7ff5b8d11744850
parentcdabaacbff447e00b196ad7d275725ab0bab8c4b
netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert

rateest_hash is supposed to be protected by xt_rateest_mutex,
and, as suggested by Eric, lookup and insert should be atomic,
so we should acquire the xt_rateest_mutex once for both.

So introduce a non-locking helper for internal use and keep the
locking one for external.

Reported-by: <syzbot+5cb189720978275e4c75@syzkaller.appspotmail.com>
Fixes: 45c061bbd95c ("[NETFILTER]: x_tables: add RATEEST target")
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_RATEEST.c