From: Jakub Kicinski <kuba@kernel.org>
To: Paul Moses <p@1g4.org>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
horms@kernel.org, jiri@resnulli.us, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net 1/2] net-shapers: clear hierarchy pointer and defer flush frees with RCU
Date: Wed, 11 Mar 2026 17:18:02 -0700 [thread overview]
Message-ID: <20260311171802.2d8a4d45@kernel.org> (raw)
In-Reply-To: <cjiUUrQ73CJYWcTmlHQVSJPUJlxVg4kSZAnqkHKnU1SKeWoyy4F2qtIw7wuFRP9qz6Ra9ax0v2EQKsgdiRRUQnnuMweGbv-n08lgvXSTTG4=@1g4.org>
On Wed, 11 Mar 2026 14:04:54 +0000 Paul Moses wrote:
> The reported UAF was in the GET doit reader path.
>
> GET doit enters rcu_read_lock(), then net_shaper_lookup() performs
> READ_ONCE(netdev->net_shaper_hierarchy) and walks the xarray locklessly.
>
> GET dump reads the hierarchy pointer first, then enters rcu_read_lock()
> and uses xa_find() to walk the xarray.
>
> Both paths rely on RCU to keep the hierarchy and its shapers valid during
> the lockless walk.
RCU was never intended to protect the whole hierarchy in shapers.
Only individual shapers inside the xarray.
The struct net_shaper_hierarchy is allocated lazily but it is never
freed during lifetime of the device, only once the device is dead.
The bug is that we are accessing a dead device.
(reminder: please quote what you're replying to correctly during ML
discussions)
next prev parent reply other threads:[~2026-03-12 0:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 17:35 [PATCH net 1/2] net-shapers: clear hierarchy pointer and defer flush frees with RCU Paul Moses
2026-03-09 17:35 ` [PATCH net 2/2] net-shapers: don't free reply skb after genlmsg_reply() Paul Moses
2026-03-11 2:28 ` [PATCH net 1/2] net-shapers: clear hierarchy pointer and defer flush frees with RCU Jakub Kicinski
2026-03-11 14:04 ` Paul Moses
2026-03-12 0:18 ` Jakub Kicinski [this message]
2026-03-12 6:05 ` Paul Moses
2026-03-12 14:25 ` Jakub Kicinski
2026-03-12 14:57 ` Paul Moses
2026-03-16 18:45 ` Paul Moses
2026-03-16 23:12 ` Jakub Kicinski
2026-03-16 23:41 ` Paul Moses
2026-03-16 23:59 ` Paul Moses
2026-03-11 2:40 ` 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=20260311171802.2d8a4d45@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=p@1g4.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.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