From: Hyunwoo Kim <imv4bel@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Eric Dumazet <edumazet@kernel.org>,
ncardwell@google.com, kuniyu@google.com, davem@davemloft.net,
kuba@kernel.org, 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: Thu, 5 Nov 2026 13:15:19 +0900 [thread overview]
Message-ID: <auwC161B4g61ptG4@v4bel> (raw)
In-Reply-To: <7f8bd24d-7538-423d-b2a9-f5b0eae99d41@redhat.com>
On Wed, Nov 04, 2026 at 08:59:50AM +0100, Paolo Abeni wrote:
> On 11/4/26 02:24, Hyunwoo Kim wrote:
> > 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?
>
> Ideally the cover letter should include a very quick/short overview of the
> changes, and a per patch changelog should include a more detailed list
> (no entry added when the patch is unmodified).
Understood. I'll do that from now on.
Best regards,
Hyunwoo Kim
next prev parent reply other threads:[~2026-11-05 4:15 UTC|newest]
Thread overview: 13+ 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
2026-11-04 7:59 ` Paolo Abeni
2026-11-05 4:15 ` Hyunwoo Kim [this message]
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=auwC161B4g61ptG4@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 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.