Skip to content

Add locking for NFT_MSG_GETSETELEM_RESET

Phil Sutter netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest3 patches 0 repliesNew

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3netfilter: nf_tables: Pass const set to nft_get_set_elemnet/netfilter/nf_tables_api.c+3 -30 replies
2/3netfilter: nf_tables: Introduce nft_set_dump_ctx_init()net/netfilter/nf_tables_api.c+33 -160 replies
3/3netfilter: nf_tables: Add locking for NFT_MSG_GETSETELEM_RESET requestsnet/netfilter/nf_tables_api.c+81 -170 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [nf-next PATCH v4 0/3] Add locking for NFT_MSG_GETSETELEM_RESET

This series attempts to solve for the potential invalidation of table and set pointers in v3's nf_tables_getsetelem_reset function.

Patch 2 introduces an initializer function for struct nft_set_dump_ctx which takes care of the table and set lookups. It will be called for NLM_F_DUMP requests to prepare the dump context and for non-NLM_F_DUMP requests inside the critical section to perform the necessary lookups. The dump context's fields are then passed to nft_get_set_elem function.

Since the 'set' field in said dump context is marked const, patch 1 is needed for called functions to respect the qualifier.

Patch 3 then adds the actual locking counterparts to nf_tables_getsetelem and nf_tables_dump_set.

Phil Sutter (3):
netfilter: nf_tables: Pass const set to nft_get_set_elem
netfilter: nf_tables: Introduce nft_set_dump_ctx_init()
netfilter: nf_tables: Add locking for NFT_MSG_GETSETELEM_RESET
requests

 net/netfilter/nf_tables_api.c | 135 +++++++++++++++++++++++++++-------
 1 file changed, 108 insertions(+), 27 deletions(-)
Signature · 1 line
2.41.0