aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2015-11-07 05:23:34 -0500
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2015-11-07 05:23:34 -0500
commite9dfdc052d018268926ab769d5b7598226713d5a (patch)
tree96d9bfe74c437af2a0b5b3c42ed808ce003feda9
parent95ad1f4a9358dff1dcf84bf5c9cc84caa9215f7f (diff)
netfilter: ipset: Fix hash:* type expiration
Incorrect index was used when the data blob was shrinked at expiration, which could lead to falsely expired entries and memory leak when the comment extension was used too. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
-rw-r--r--net/netfilter/ipset/ip_set_hash_gen.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
index 4ff22194ce55..fa4f6374bb73 100644
--- a/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/net/netfilter/ipset/ip_set_hash_gen.h
@@ -523,7 +523,7 @@ mtype_expire(struct ip_set *set, struct htype *h, u8 nets_length, size_t dsize)
523 continue; 523 continue;
524 data = ahash_data(n, j, dsize); 524 data = ahash_data(n, j, dsize);
525 memcpy(tmp->value + d * dsize, data, dsize); 525 memcpy(tmp->value + d * dsize, data, dsize);
526 set_bit(j, tmp->used); 526 set_bit(d, tmp->used);
527 d++; 527 d++;
528 } 528 }
529 tmp->pos = d; 529 tmp->pos = d;