Skip to content

netfilter: nf_tables: avoid PROVE_RCU_LIST splats

Florian Westphal netfilter-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 1 replyIn review
  2. v27 patches 12 repliesSuperseded
  3. v17 patches 5 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7netfilter: nf_tables: avoid false-positive lockdep splat on rule deletionnet/netfilter/nf_tables_api.c+13 -100 replies
2/7netfilter: nf_tables: avoid false-positive lockdep splats with setsnet/netfilter/nf_tables_api.c+16 -110 replies
3/7netfilter: nf_tables: avoid false-positive lockdep splats with flowtablesinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nft_flow_offload.c+13 -90 replies
4/7netfilter: nf_tables: avoid false-positive lockdep splats in set walkernet/netfilter/nft_set_bitmap.c net/netfilter/nft_set_hash.c+8 -50 replies
5/7netfilter: nf_tables: avoid false-positive lockdep splats with basechain hooknet/netfilter/nf_tables_api.c+5 -30 replies
6/7netfilter: nf_tables: must hold rcu read lock while iterating expression type listnet/netfilter/nf_tables_api.c+18 -60 replies
7/7netfilter: nf_tables: must hold rcu read lock while iterating object type listnet/netfilter/nf_tables_api.c+6 -70 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by.

PatchMatthieu Baerts
1/7T-b
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH nf-next v3 0/7] netfilter: nf_tables: avoid PROVE_RCU_LIST splats

v3: don't check for type->owner and add comment saying check on inner_ops is enough.
Use IS_ERR() instead of ptr == NULL in patch 7/7.
No other changes.

Mathieu reported a lockdep splat on rule deletion with CONFIG_RCU_LIST=y.

Unfortunately there are many more errors, and not all are false positives.

First patches pass lockdep_commit_lock_is_held() to the rcu list traversal macro so that those splats are avoided.

The last two patches are real code change as opposed to 'pass the transaction mutex to relax rcu check':

Those two lists are not protected by transaction mutex so could be altered in parallel in case of module load/removal.

Florian Westphal (7):
netfilter: nf_tables: avoid false-positive lockdep splat on rule
deletion
netfilter: nf_tables: avoid false-positive lockdep splats with sets
netfilter: nf_tables: avoid false-positive lockdep splats with
flowtables
netfilter: nf_tables: avoid false-positive lockdep splats in set
walker
netfilter: nf_tables: avoid false-positive lockdep splats with
basechain hook
netfilter: nf_tables: must hold rcu read lock while iterating
expression type list
netfilter: nf_tables: must hold rcu read lock while iterating object
type list

 include/net/netfilter/nf_tables.h |   3 +-
 net/netfilter/nf_tables_api.c     | 110 ++++++++++++++++++------------
 net/netfilter/nft_flow_offload.c  |   4 +-
 net/netfilter/nft_set_bitmap.c    |  10 +--
 net/netfilter/nft_set_hash.c      |   3 +-
 5 files changed, 79 insertions(+), 51 deletions(-)
Signature · 1 line
2.45.2