Skip to content

netfilter: nft_set_rbtree: use cloned tree for insertions and removal

Florian Westphal netfilter-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 0 repliesNew
  2. v13 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- rebase on nf
- fix a sparse warning reported by kbuild robot

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3netfilter: nft_set_rbtree: prepare for two rbtreesnet/netfilter/nft_set_rbtree.c+64 -390 replies
2/3netfilter: nft_set_rbtree: factor out insert helpernet/netfilter/nft_set_rbtree.c+38 -190 replies
3/3netfilter: nft_set_rbtree: do not modifiy live treenet/netfilter/nft_set_rbtree.c+132 -360 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 nf 0/3] netfilter: nft_set_rbtree: use cloned tree for insertions and removal

Changes since v1:
- rebase on nf
- fix a sparse warning reported by kbuild robot

This series fixes false negative lookup bug in rbtree set backend that can occur during transaction.

First two patches prepare for actual fix, which is coming in last patch.

All inserts/removals will now occur in a cloned copy, so packetpath can no longer observe the problematic mixed-bag of old, current and new elements.

The live tree will only have reachable elements that are active in the current generation or were active in the previous generation (but are still valid while packetpath holds rcu read lock). The latter case is only temporary, new lookups use the updated tree.

Florian Westphal (3):
netfilter: nft_set_rbtree: prepare for two rbtrees
netfilter: nft_set_rbtree: factor out insert helper
netfilter: nft_set_rbtree: do not modifiy live tree

 net/netfilter/nft_set_rbtree.c | 290 ++++++++++++++++++++++++---------
 1 file changed, 215 insertions(+), 75 deletions(-)
Signature · 1 line
2.51.2