aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/netfilter/arp_tables.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-02-27 19:42:33 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-03-05 23:15:43 +0100
commitc84ca954ac9fa67a6ce27f91f01e4451c74fd8f6 (patch)
tree3e3b78cb632b28a76a764889f71c8e77f1e440c9 /net/ipv4/netfilter/arp_tables.c
parentnetfilter: x_tables: limit allocation requests for blob rule heads (diff)
downloadwireguard-linux-c84ca954ac9fa67a6ce27f91f01e4451c74fd8f6.tar.xz
wireguard-linux-c84ca954ac9fa67a6ce27f91f01e4451c74fd8f6.zip
netfilter: x_tables: add counters allocation wrapper
allows to have size checks in a single spot. This is supposed to reduce oom situations when fuzz-testing xtables. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4/netfilter/arp_tables.c')
-rw-r--r--net/ipv4/netfilter/arp_tables.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index be5821215ea0..82ba09b50fdb 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -883,7 +883,7 @@ static int __do_replace(struct net *net, const char *name,
struct arpt_entry *iter;
ret = 0;
- counters = vzalloc(num_counters * sizeof(struct xt_counters));
+ counters = xt_counters_alloc(num_counters);
if (!counters) {
ret = -ENOMEM;
goto out;