From: Hyunwoo Kim <imv4bel@gmail.com>
To: Eric Dumazet <edumazet@kernel.org>
Cc: ncardwell@google.com, kuniyu@google.com, davem@davemloft.net,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
martin.lau@linux.dev, john.fastabend@gmail.com,
weiwan@google.com, sd@queasysnail.net, jiayuan.chen@linux.dev,
netdev@vger.kernel.org, stable@vger.kernel.org,
imv4bel@gmail.com
Subject: Re: [PATCH net v5 2/2] net: restore refcount ordering for lockless socket access
Date: Wed, 4 Nov 2026 10:24:10 +0900 [thread overview]
Message-ID: <auqJOj7RVCWn7Ucl@v4bel> (raw)
In-Reply-To: <CAL4WiioDoAT-50wStYDOy0b7f972QivB=Zk_7TCDrVPfOY665A@mail.gmail.com>
On Tue, Nov 03, 2026 at 03:49:40PM +0100, Eric Dumazet wrote:
> Le jeu. 29 oct. 2026 à 22:42, Hyunwoo Kim <imv4bel@gmail.com> a écrit :
> >
> > Before commit fb041bb7c0a9 ("locking/refcount: Consolidate implementations
> > of refcount_t"), default builds implemented refcount_inc_not_zero() using
> > atomic_add_unless(), which provided full memory ordering on success. The
> > commit removed that ordering on weakly ordered architectures, allowing
> > accesses after a successful reference acquisition to be reordered before
> > it.
> >
> > Use refcount_inc_not_zero_acquire() in the IPv4 and IPv6 established
> > lookups and in inet_twsk_purge(), where the socket is validated again
> > after taking a reference.
> >
> > bpf_sk_assign() can receive a socket pointer obtained through BTF
> > without a reference. Use acquire ordering when it takes its own reference
> > for a refcounted socket.
> >
> > Use refcount_set_release() when setting refcounts in the SYN cookie,
> > TCP Fast Open, request migration, and TIME_WAIT paths. Keep the existing
> > TIME_WAIT smp_wmb(), which separately orders the refcount store before
> > ehash publication.
> >
> > Fixes: fb041bb7c0a9 ("locking/refcount: Consolidate implementations of refcount_t")
> > Fixes: 27e5203bd9c5 ("bpf: Change bpf_sk_assign to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
> > ---
>
> Lack of links to prior versions is rather annoying.
Is the cover letter alone insufficient?
Should the changelog be in each patch?
next prev parent reply other threads:[~2026-11-04 1:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 21:42 [PATCH net v5 0/2] inet: fix lockless ehash walk races Hyunwoo Kim
2026-10-29 21:42 ` [PATCH net v5 1/2] inet: reject unhashed sockets during established lookups Hyunwoo Kim
2026-11-02 22:06 ` netdev-bot+sashiko
2026-10-29 21:42 ` [PATCH net v5 2/2] net: restore refcount ordering for lockless socket access Hyunwoo Kim
2026-10-29 21:55 ` Kuniyuki Iwashima
2026-11-02 22:06 ` netdev-bot+sashiko
2026-11-03 7:47 ` Hyunwoo Kim
2026-11-03 14:30 ` Paolo Abeni
2026-11-03 14:49 ` Eric Dumazet
2026-11-04 1:24 ` Hyunwoo Kim [this message]
2026-11-04 7:59 ` Paolo Abeni
2026-11-03 14:40 ` [PATCH net v5 0/2] inet: fix lockless ehash walk races patchwork-bot+netdevbpf
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=auqJOj7RVCWn7Ucl@v4bel \
--to=imv4bel@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jiayuan.chen@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=martin.lau@linux.dev \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=stable@vger.kernel.org \
--cc=weiwan@google.com \
/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