]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nf_tables: integrate pipapo into commit protocol
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 7 Jun 2023 09:55:42 +0000 (11:55 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 8 Jun 2023 01:56:20 +0000 (03:56 +0200)
commit212ed75dc5fb9d1423b3942c8f872a868cda3466
treeca58203dac4ad8cd4680c648c2d71d1daf4b869d
parentab39b113e74751958aac1b125a14ee42bd7d3efd
netfilter: nf_tables: integrate pipapo into commit protocol

The pipapo set backend follows copy-on-update approach, maintaining one
clone of the existing datastructure that is being updated. The clone
and current datastructures are swapped via rcu from the commit step.

The existing integration with the commit protocol is flawed because
there is no operation to clean up the clone if the transaction is
aborted. Moreover, the datastructure swap happens on set element
activation.

This patch adds two new operations for sets: commit and abort, these new
operations are invoked from the commit and abort steps, after the
transactions have been digested, and it updates the pipapo set backend
to use it.

This patch adds a new ->pending_update field to sets to maintain a list
of sets that require this new commit and abort operations.

Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_set_pipapo.c