diff options
author | Florian Westphal <fw@strlen.de> | 2016-10-17 15:50:23 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-19 12:32:24 -0400 |
commit | 1ecc281ec2f52d715dfc8cb67b6820ea813b9e52 (patch) | |
tree | 8a18765d57aee4fff59cea82dbd0f72ac5dcd79c | |
parent | d2e4d593516e877f1f6fb40031eb495f36606e16 (diff) |
netfilter: x_tables: suppress kmemcheck warning
Markus Trippelsdorf reports:
WARNING: kmemcheck: Caught 64-bit read from uninitialized memory (ffff88001e605480)
4055601e0088ffff000000000000000090686d81ffffffff0000000000000000
u u u u u u u u u u u u u u u u i i i i i i i i u u u u u u u u
^
|RIP: 0010:[<ffffffff8166e561>] [<ffffffff8166e561>] nf_register_net_hook+0x51/0x160
[..]
[<ffffffff8166e561>] nf_register_net_hook+0x51/0x160
[<ffffffff8166eaaf>] nf_register_net_hooks+0x3f/0xa0
[<ffffffff816d6715>] ipt_register_table+0xe5/0x110
[..]
This warning is harmless; we copy 'uninitialized' data from the hook ops
but it will not be used.
Long term the structures keeping run-time data should be disentangled
from those only containing config-time data (such as where in the list
to insert a hook), but thats -next material.
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Suggested-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/x_tables.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index e0aa7c1d0224..fc4977456c30 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -1513,7 +1513,7 @@ xt_hook_ops_alloc(const struct xt_table *table, nf_hookfn *fn) | |||
1513 | if (!num_hooks) | 1513 | if (!num_hooks) |
1514 | return ERR_PTR(-EINVAL); | 1514 | return ERR_PTR(-EINVAL); |
1515 | 1515 | ||
1516 | ops = kmalloc(sizeof(*ops) * num_hooks, GFP_KERNEL); | 1516 | ops = kcalloc(num_hooks, sizeof(*ops), GFP_KERNEL); |
1517 | if (ops == NULL) | 1517 | if (ops == NULL) |
1518 | return ERR_PTR(-ENOMEM); | 1518 | return ERR_PTR(-ENOMEM); |
1519 | 1519 | ||