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: v4.11-rc1~93^2~1^2^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=50054a9223aaf79985c55ef7dd090ced15581567;p=karo-tx-linux.git 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 Signed-off-by: Jozsef Kadlecsik --- diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 1b05d4a7d5a1..f236c0bc7b3f 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h @@ -897,7 +897,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;