]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone
authorFlorian Westphal <fw@strlen.de>
Wed, 5 Jan 2022 13:19:54 +0000 (14:19 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 6 Jan 2022 09:43:24 +0000 (10:43 +0100)
commit23c54263efd7cb605e2f7af72717a2a951999217
tree3557c86971631656b3b5b5012517af984bd90d2a
parent4e1860a3863707e8177329c006d10f9e37e097a8
netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone

This is needed in case a new transaction is made that doesn't insert any
new elements into an already existing set.

Else, after second 'nft -f ruleset.txt', lookups in such a set will fail
because ->lookup() encounters raw_cpu_ptr(m->scratch) == NULL.

For the initial rule load, insertion of elements takes care of the
allocation, but for rule reloads this isn't guaranteed: we might not
have additions to the set.

Fixes: 3c4287f62044a90e ("nf_tables: Add set type for arbitrary concatenation of ranges")
Reported-by: etkaar <lists.netfilter.org@prvy.eu>
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_set_pipapo.c