]> git.ipfire.org Git - thirdparty/linux.git/commit
netfilter: synproxy: add mutex to guard hook reference counting
authorFernando Fernandez Mancera <fmancera@suse.de>
Tue, 26 May 2026 21:58:31 +0000 (23:58 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Jun 2026 11:43:53 +0000 (13:43 +0200)
commit2fcba19caaeb2a33017459d3430f057967bb91b6
treefd1dec24cb0abc3f3655c7bcd788e27e5a841f39
parent36d29ceec32c8206a12dc2810cf65fd394e45baa
netfilter: synproxy: add mutex to guard hook reference counting

As the synproxy infrastructure register netfilter hooks on-demand when a
user adds the first iptables target or nftables expression, if done
concurrently they can race each other.

Introduce a mutex to serialize the refcount control blocks access from
both frontends. While a per namespace mutex might be more efficient, it
is not needed for target/expression like SYNPROXY.

Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_synproxy_core.c