From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf 4/4] netfilter: nf_conntrack: fix crash due to removal of uninitialised entry
Date: Thu, 3 Jul 2025 16:21:51 +0200 [thread overview]
Message-ID: <aGaR_xFIrY6pwY2b@strlen.de> (raw)
In-Reply-To: <aGaLwPfOwyEFmh7w@calendula>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> Thanks for the description, this scenario is esoteric.
>
> Is this bug fully reproducible?
No. Unicorn. Only happened once.
Everything is based off reading the backtrace and vmcore.
> > + /* IPS_CONFIRMED unset means 'ct not (yet) in hash', conntrack lookups
> > + * skip entries that lack this bit. This happens when a CPU is looking
> > + * at a stale entry that is being recycled due to SLAB_TYPESAFE_BY_RCU
> > + * or when another CPU encounters this entry right after the insertion
> > + * but before the set-confirm-bit below.
> > + */
> > + ct->status |= IPS_CONFIRMED;
>
> My understanding is that this bit setting can still be reordered.
You mean it could be moved before hlist_add? So this is needed?
- ct->status |= IPS_CONFIRMED;
+ smp_mb__before_atomic();
+ set_bit(IPS_CONFIRMED_BIT, &ct->status) ?
I can send a v2 with this change.
next prev parent reply other threads:[~2025-07-03 14:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 14:27 [PATCH nf 0/4] netfilter: conntrack: fix obscure confirmed race Florian Westphal
2025-06-27 14:27 ` [PATCH nf 1/4] selftests: netfilter: conntrack_resize.sh: extend resize test Florian Westphal
2025-06-27 14:27 ` [PATCH nf 2/4] selftests: netfilter: add conntrack clash resolution test case Florian Westphal
2025-06-27 14:27 ` [PATCH nf 3/4] selftests: netfilter: conntrack_resize.sh: also use udpclash tool Florian Westphal
2025-06-27 14:27 ` [PATCH nf 4/4] netfilter: nf_conntrack: fix crash due to removal of uninitialised entry Florian Westphal
2025-07-03 13:56 ` Pablo Neira Ayuso
2025-07-03 14:21 ` Florian Westphal [this message]
2025-07-14 13:51 ` Pablo Neira Ayuso
2025-07-14 14:36 ` Florian Westphal
2025-07-15 22:09 ` Pablo Neira Ayuso
2025-07-16 15:59 ` Florian Westphal
2025-07-16 17:00 ` Pablo Neira Ayuso
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=aGaR_xFIrY6pwY2b@strlen.de \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).