netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nf PATCH 0/5] Introduce locking for reset requests
@ 2023-09-23  1:38 Phil Sutter
  2023-09-23  1:38 ` [nf PATCH 1/5] netfilter: nf_tables: Don't allocate nft_rule_dump_ctx Phil Sutter
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Phil Sutter @ 2023-09-23  1:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, Florian Westphal

Introduce a spin lock to serialize expression reset operations as
concurrent resetting of the same expression may lead to unexpected
results.

Original approach coined by Pablo and Florian, a remaining puzzle to
solve was the claim to avoid conditional spinlock calls. To achieve
this, follow Florian's suggested way of introducing dedicated nfnetlink
callbacks for *_RESET requests.

Avoiding the check for whether reset operation being requested in
callbacks is a close call, but the info must be carried into the dump
callback as well. While doing this, refactor the touched dump start
routines to embed the context into struct netlink_callback::ctx instead
of allocating it.

Phil Sutter (5):
  netfilter: nf_tables: Don't allocate nft_rule_dump_ctx
  netfilter: nf_tables: Add locking for NFT_MSG_GETRULE_RESET requests
  netfilter: nf_tables: Introduce struct nft_obj_dump_ctx
  netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests
  netfilter: nf_tables: Add locking for NFT_MSG_GETSETELEM_RESET
    requests

 include/net/netfilter/nf_tables.h |   1 +
 net/netfilter/nf_tables_api.c     | 528 ++++++++++++++++++++----------
 2 files changed, 353 insertions(+), 176 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-09-27 12:55 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-23  1:38 [nf PATCH 0/5] Introduce locking for reset requests Phil Sutter
2023-09-23  1:38 ` [nf PATCH 1/5] netfilter: nf_tables: Don't allocate nft_rule_dump_ctx Phil Sutter
2023-09-23  1:38 ` [nf PATCH 2/5] netfilter: nf_tables: Add locking for NFT_MSG_GETRULE_RESET requests Phil Sutter
2023-09-23 11:04   ` Florian Westphal
2023-09-23 15:03     ` Phil Sutter
2023-09-23 16:18       ` Florian Westphal
2023-09-25  9:32         ` Pablo Neira Ayuso
2023-09-25 19:53           ` Florian Westphal
2023-09-26  9:34             ` Phil Sutter
2023-09-26 10:09               ` Pablo Neira Ayuso
2023-09-26 12:14                 ` Phil Sutter
2023-09-26 13:34                   ` Pablo Neira Ayuso
2023-09-26 13:59                     ` Phil Sutter
2023-09-27 11:41                       ` Florian Westphal
2023-09-27 12:54                         ` Phil Sutter
2023-09-25 11:02     ` Pablo Neira Ayuso
2023-09-25 10:47   ` Pablo Neira Ayuso
2023-09-26  9:14     ` Phil Sutter
2023-09-26 10:00       ` Pablo Neira Ayuso
2023-09-25 10:48   ` Pablo Neira Ayuso
2023-09-25 11:01     ` Pablo Neira Ayuso
2023-09-23  1:38 ` [nf PATCH 3/5] netfilter: nf_tables: Introduce struct nft_obj_dump_ctx Phil Sutter
2023-09-23  1:38 ` [nf PATCH 4/5] netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests Phil Sutter
2023-09-23  1:38 ` [nf PATCH 5/5] netfilter: nf_tables: Add locking for NFT_MSG_GETSETELEM_RESET requests Phil Sutter
2023-09-25 10:53   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).