From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Michael Bommarito <michael.bommarito@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
James Chapman <jchapman@katalix.com>,
Tom Parkin <tparkin@katalix.com>,
Guillaume Nault <gnault@redhat.com>,
Simon Horman <horms@kernel.org>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>, Kees Cook <kees@kernel.org>,
netdev@vger.kernel.org, linux-rt-devel@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname
Date: Wed, 27 May 2026 09:16:14 +0200 [thread overview]
Message-ID: <20260527071614.MwD6LIK5@linutronix.de> (raw)
In-Reply-To: <20260523023423.2568972-1-michael.bommarito@gmail.com>
sorry for being late…
On 2026-05-22 22:34:23 [-0400], Michael Bommarito wrote:
…
> a slab-use-after-free. On PREEMPT_RT local_bh_disable() is a per-CPU
> sleeping lock and the preemption window is real;
No, it is not but there is a preemption window, yes.
> on stock PREEMPT
> kernels local_bh_disable() is a preempt_count increment that closes
> the cross-CPU race in practice (see below).
It might be that the window is not wide open. I don't see why it should
not trigger on SMP.
> Use refcount_inc_not_zero() and continue the list walk on failure,
> matching the other session getters in the file. The ifname getter
> is the only session getter in net/l2tp/ that still uses the bare
> refcount_inc() pattern; this change restores file-internal
> consistency. The success path is unchanged.
This is the right change.
> Fixes: abe7a1a7d0b6 ("l2tp: improve tunnel/session refcount helpers")
This simply removes the wrapper but the logic is the same. Wouldn't
commit 2777e2ab5a9cf ("l2tp: take a reference on sessions used in
genetlink handlers") be where it was introduced?
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-4-7
> Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
…
Sebastian
prev parent reply other threads:[~2026-05-27 7:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260523023423.2568972-1-michael.bommarito@gmail.com>
2026-05-26 6:44 ` [PATCH net] l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname James Chapman
2026-05-26 16:52 ` Simon Horman
2026-05-27 1:00 ` patchwork-bot+netdevbpf
2026-05-27 7:16 ` Sebastian Andrzej Siewior [this message]
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=20260527071614.MwD6LIK5@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gnault@redhat.com \
--cc=horms@kernel.org \
--cc=jchapman@katalix.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=michael.bommarito@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tparkin@katalix.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