Skip to content

Commit

Permalink
netfilter: ipset: Fix hash:* type expiration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jozsef Kadlecsik committed Nov 7, 2015
1 parent 95ad1f4 commit e9dfdc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/ipset/ip_set_hash_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ mtype_expire(struct ip_set *set, struct htype *h, u8 nets_length, size_t dsize)
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;
Expand Down

0 comments on commit e9dfdc0

Please sign in to comment.