diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2013-10-18 14:03:41 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2013-10-27 19:24:39 +0100 |
commit | dc476e7c8e7824fd326c79f50d7302faca7a4c2b (patch) | |
tree | ccdeee796df0a5a1e77755e9e6746f3d1aa1f1ef /net/netfilter/ipset | |
parent | f2020b27be94222eb25c39ff46eb9917cb92897b (diff) | |
download | op-kernel-dev-dc476e7c8e7824fd326c79f50d7302faca7a4c2b.zip op-kernel-dev-dc476e7c8e7824fd326c79f50d7302faca7a4c2b.tar.gz |
netfilter:ipset: Fix memory allocation for bitmap:port
At the restructuring of the bitmap types creation in ipset, for the
bitmap:port type wrong (too large) memory allocation was copied
(netfilter bugzilla id #859).
Reported-by: Quentin Armitage <quentin@armitage.org.uk>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'net/netfilter/ipset')
-rw-r--r-- | net/netfilter/ipset/ip_set_bitmap_port.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_bitmap_port.c b/net/netfilter/ipset/ip_set_bitmap_port.c index e7603c5..cf99676 100644 --- a/net/netfilter/ipset/ip_set_bitmap_port.c +++ b/net/netfilter/ipset/ip_set_bitmap_port.c @@ -254,7 +254,7 @@ bitmap_port_create(struct net *net, struct ip_set *set, struct nlattr *tb[], return -ENOMEM; map->elements = last_port - first_port + 1; - map->memsize = map->elements * sizeof(unsigned long); + map->memsize = bitmap_bytes(0, map->elements); set->variant = &bitmap_port; set->dsize = ip_set_elem_len(set, tb, 0); if (!init_map_port(set, map, first_port, last_port)) { |