]> git.hungrycats.org Git - linux/commit
netfilter: nf_conncount: add sequence counter to detect tree modifications
authorFlorian Westphal <fw@strlen.de>
Fri, 5 Jun 2026 13:11:22 +0000 (15:11 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 14 Jun 2026 10:51:54 +0000 (12:51 +0200)
commit635a10f6d07641b1588fdf251dd83d9f48b6ca0e
tree808ffc086ae7f6f4259371eb2af12b7707fd13c0
parent2e064ae85942f062dc854d0c2877a3f6cd86c0db
netfilter: nf_conncount: add sequence counter to detect tree modifications

There a two issues with traversal:
1. Key lookup (tree search) cannot detect concurrent modifications and may
   not find a result in case of parallel modification.

2. Worker does a lockless iteration.  This is never safe.

Add a sequence counter and re-do the lookup under lock in case the
tree was modified / seqcount changed.

gc_worker bugs are addressed in the next patch.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conncount.c