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-18 14:16:18 +0200 |
commit | 6e85776d53e2ceb559cc43f70c14b90303aa8a94 (patch) | |
tree | 3a98eec361bf46480f8e992a6d502cf2ab478297 | |
parent | a76488a84db452865e114336b3fde6257e327715 (diff) | |
download | ipset-6e85776d53e2ceb559cc43f70c14b90303aa8a94.tar.gz |
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>
-rw-r--r-- | kernel/net/netfilter/ipset/ip_set_bitmap_port.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_bitmap_port.c b/kernel/net/netfilter/ipset/ip_set_bitmap_port.c index e7603c5..cf99676 100644 --- a/kernel/net/netfilter/ipset/ip_set_bitmap_port.c +++ b/kernel/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)) { |