From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Zihan Xi <zihanx@nebusec.ai>
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
alex.aring@gmail.com, stefan@datenfreihafen.org,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
horms@kernel.org, david.girault@qorvo.com, vega@nebusec.ai
Subject: Re: [PATCH net 1/1] mac802154: fix netdev use-after-free in beacon worker
Date: Tue, 04 Aug 2026 12:40:03 +0200 [thread overview]
Message-ID: <87ecgegoe4.fsf@bootlin.com> (raw)
In-Reply-To: <e9a3909c7a6281967961773ca841e860b8ecf40e.1785596603.git.zihanx@nebusec.ai> (Zihan Xi's message of "Sun, 2 Aug 2026 09:23:34 +0000")
On 02/08/2026 at 09:23:34 GMT, Zihan Xi <zihanx@nebusec.ai> wrote:
> mac802154_beacon_worker() reads local->beacon_req under RCU and derives
> the sub-interface from the request, but then drops the RCU read lock and
> continues to use both sdata and the embedded wpan_dev.
>
> mac802154_stop_beacons_locked() cancels only pending beacon work, clears
> local->beacon_req and frees the request. A beacon worker that is already
> running can therefore continue after interface teardown and dereference
> the freed netdev private area.
>
> The scan worker already pins the netdev before leaving RCU. Apply the
> same lifetime rule to the beacon worker: take a netdev reference while
> the request is still protected by RCU, and release it on all paths that
> continue after the reference is acquired.
>
> Fixes: 3accf4762734 ("mac802154: Handle basic beaconing")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: Codex:gpt-5.4
> Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Looks okay.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
next prev parent reply other threads:[~2026-08-04 10:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 9:23 [PATCH net 0/1] mac802154: Fix beacon worker UAF Zihan Xi
2026-08-02 9:23 ` [PATCH net 1/1] mac802154: fix netdev use-after-free in beacon worker Zihan Xi
2026-08-04 10:40 ` Miquel Raynal [this message]
2026-08-06 0:30 ` [PATCH net 0/1] mac802154: Fix beacon worker UAF 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=87ecgegoe4.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=david.girault@qorvo.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stefan@datenfreihafen.org \
--cc=vega@nebusec.ai \
--cc=zihanx@nebusec.ai \
/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