[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180201002631.17638-1-xiyou.wangcong@gmail.com>
Date: Wed, 31 Jan 2018 16:26:31 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: netfilter-devel@...r.kernel.org,
Cong Wang <xiyou.wangcong@...il.com>,
Pablo Neira Ayuso <pablo@...filter.org>
Subject: [Patch net] xt_RATEEST: acquire xt_rateest_mutex for hash insert
rateest_hash is supposed to be protected by xt_rateest_mutex.
Reported-by: <syzbot+5cb189720978275e4c75@...kaller.appspotmail.com>
Fixes: 5859034d7eb8 ("[NETFILTER]: x_tables: add RATEEST target")
Cc: Pablo Neira Ayuso <pablo@...filter.org>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
---
net/netfilter/xt_RATEEST.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c
index 498b54fd04d7..83ec3a282755 100644
--- a/net/netfilter/xt_RATEEST.c
+++ b/net/netfilter/xt_RATEEST.c
@@ -36,7 +36,9 @@ static void xt_rateest_hash_insert(struct xt_rateest *est)
unsigned int h;
h = xt_rateest_hash(est->name);
+ mutex_lock(&xt_rateest_mutex);
hlist_add_head(&est->list, &rateest_hash[h]);
+ mutex_unlock(&xt_rateest_mutex);
}
struct xt_rateest *xt_rateest_lookup(const char *name)
--
2.13.0
Powered by blists - more mailing lists