From: Jozsef Kadlecsik Date: Thu, 16 Feb 2017 19:47:30 +0000 (+0100) Subject: Fix bug: sometimes valid entries in hash:* types of sets were evicted X-Git-Tag: v6.31~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=728fed0f689c76cb5cd77499b022764e93d91932;p=ipset Fix bug: sometimes valid entries in hash:* types of sets were evicted Wrong index was used and therefore when shrinking a hash bucket at deleting an entry, valid entries could be evicted as well. Thanks to Eric Ewanco for the thorough bugreport. Fixes netfilter bugzilla #1119 --- diff --git a/kernel/net/netfilter/ipset/ip_set_hash_gen.h b/kernel/net/netfilter/ipset/ip_set_hash_gen.h index 673c7aa..f66cad2 100644 --- a/kernel/net/netfilter/ipset/ip_set_hash_gen.h +++ b/kernel/net/netfilter/ipset/ip_set_hash_gen.h @@ -898,7 +898,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext, continue; data = ahash_data(n, j, dsize); memcpy(tmp->value + k * dsize, data, dsize); - set_bit(j, tmp->used); + set_bit(k, tmp->used); k++; } tmp->pos = k;