netfilter: nf_tables: set element timeout update support
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 2 Sep 2024 23:09:58 +0000 (01:09 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 3 Sep 2024 16:19:44 +0000 (18:19 +0200)
commit4201f3938914d8df3c761754b9726770c4225d66
tree50dfd475b57541f94aaf179cdc228a094f6e74b6
parent8bfb74ae12fa4cd3c9b49bb5913610b5709bffd7
netfilter: nf_tables: set element timeout update support

Store new timeout and expiration in transaction object, use them to
update elements from .commit path. Otherwise, discard update if .abort
path is exercised.

Use update_flags in the transaction to note whether the timeout,
expiration, or both need to be updated.

Annotate access to timeout extension now that it can be updated while
lockless read access is possible.

Reject timeout updates on elements with no timeout extension.

Element transaction remains in the 96 bytes kmalloc slab on x86_64 after
this update.

This patch requires ("netfilter: nf_tables: use timestamp to check for
set element timeout") to make sure an element does not expire while
transaction is ongoing.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_dynset.c