From: Jozsef Kadlecsik Date: Wed, 4 Nov 2015 08:28:29 +0000 (+0100) Subject: Fix hash:* type expiration X-Git-Tag: v6.27~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7623e1bcf0be0c65e2abc9a0dcd3ec606e501dc5;p=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 --- diff --git a/kernel/net/netfilter/ipset/ip_set_hash_gen.h b/kernel/net/netfilter/ipset/ip_set_hash_gen.h index 63a1733..d774059 100644 --- a/kernel/net/netfilter/ipset/ip_set_hash_gen.h +++ b/kernel/net/netfilter/ipset/ip_set_hash_gen.h @@ -512,7 +512,7 @@ mtype_expire(struct ip_set *set, struct htype *h) continue; data = ahash_data(n, j, dsize); memcpy(tmp->value + d * dsize, data, dsize); - set_bit(j, tmp->used); + set_bit(d, tmp->used); d++; } tmp->pos = d;