From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
fw@strlen.de, phil@nwl.cc
Subject: Re: [PATCH 4/5 nf-next v3] netfilter: synproxy: protect nf_ct_seqadj_init() with conntrack lock
Date: Tue, 26 May 2026 16:59:31 +0200 [thread overview]
Message-ID: <ahW1U9_ESybsuAlv@chamomile> (raw)
In-Reply-To: <20260526141838.4191-5-fmancera@suse.de>
Hi Fernando,
linux$ git grep nf_ct_seqadj_init
net/netfilter/nf_conntrack_seqadj.c:int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
net/netfilter/nf_conntrack_seqadj.c:EXPORT_SYMBOL_GPL(nf_ct_seqadj_init);
net/netfilter/nf_synproxy_core.c: nf_ct_seqadj_init(ct, ctinfo, synproxy->isn -
net/netfilter/nf_synproxy_core.c: nf_ct_seqadj_init(ct, ctinfo, 0);
net/netfilter/nf_synproxy_core.c: nf_ct_seqadj_init(ct, ctinfo, synproxy->isn - ntohl(th->seq));
net/netfilter/nf_synproxy_core.c: nf_ct_seqadj_init(ct, ctinfo, synproxy->isn -
net/netfilter/nf_synproxy_core.c: nf_ct_seqadj_init(ct, ctinfo, 0);
net/netfilter/nf_synproxy_core.c: nf_ct_seqadj_init(ct, ctinfo, synproxy->isn - ntohl(th->seq));
On Tue, May 26, 2026 at 04:18:37PM +0200, Fernando Fernandez Mancera wrote:
> diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
> index 5413133a42fa..3e02e252eecc 100644
> --- a/net/netfilter/nf_synproxy_core.c
> +++ b/net/netfilter/nf_synproxy_core.c
> @@ -669,8 +669,10 @@ ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
> switch (state->state) {
> case TCP_CONNTRACK_CLOSE:
> if (th->rst && CTINFO2DIR(ctinfo) != IP_CT_DIR_ORIGINAL) {
> + spin_lock_bh(&ct->lock);
> nf_ct_seqadj_init(ct, ctinfo, synproxy->isn -
> ntohl(th->seq) + 1);
> + spin_unlock_bh(&ct->lock);
> break;
Maybe add the spin_lock to nf_ct_seqadj_init() given synproxy is the
only user of this function?
> }
>
next prev parent reply other threads:[~2026-05-26 14:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 14:18 [PATCH 0/5 nf-next v3] netfilter: synproxy: misc fixes about synproxy core Fernando Fernandez Mancera
2026-05-26 14:18 ` [PATCH 1/5 nf-next v3] netfilter: synproxy: drop packets if timestamp adjustment fails Fernando Fernandez Mancera
2026-05-26 14:18 ` [PATCH 2/5 nf-next v3] netfilter: synproxy: adjust duplicate timestamp options Fernando Fernandez Mancera
2026-05-26 14:18 ` [PATCH 3/5 nf-next v3] netfilter: synproxy: fix unaligned memory access in timestamp adjustment Fernando Fernandez Mancera
2026-05-26 14:18 ` [PATCH 4/5 nf-next v3] netfilter: synproxy: protect nf_ct_seqadj_init() with conntrack lock Fernando Fernandez Mancera
2026-05-26 14:59 ` Pablo Neira Ayuso [this message]
2026-05-26 21:18 ` Fernando Fernandez Mancera
2026-05-26 14:18 ` [PATCH 5/5 nf-next v3] netfilter: synproxy: add mutex to guard hook reference counting Fernando Fernandez Mancera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ahW1U9_ESybsuAlv@chamomile \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=fmancera@suse.de \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.