Netdev List
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Yichong Chen <chenyichong@uniontech.com>
Cc: Alexander Aring <alex.aring@gmail.com>,
	 Stefan Schmidt <stefan@datenfreihafen.org>,
	 linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org,  Zhan Jun <zhanjun@uniontech.com>,
	syzbot+8a8482d4c33cc58babb4@syzkaller.appspotmail.com,
	stable@vger.kernel.org
Subject: Re: [PATCH net] ieee802154: hwsim: free PIB after hardware unregister
Date: Tue, 17 Nov 2026 11:17:36 +0100	[thread overview]
Message-ID: <87ld6rn4n3.fsf@bootlin.com> (raw)
In-Reply-To: <0D7C088B45E7283A+20261113134141.2626113-1-chenyichong@uniontech.com> (Yichong Chen's message of "Fri, 13 Nov 2026 21:41:41 +0800")

On 13/11/2026 at 21:41:41 +08, Yichong Chen <chenyichong@uniontech.com> wrote:

> From: Zhan Jun <zhanjun@uniontech.com>
>
> hwsim_del() queued the current PIB for RCU freeing before calling
> ieee802154_unregister_hw(). Unregistering the hardware closes its
> interfaces and aborts an in-progress scan; scan cleanup calls
> set_channel(), which replaces the same phy->pib and queues the old object
> for RCU freeing again. KASAN then reports an invalid free in
> hwsim_update_pib().
>
> Unregister the hardware first, then atomically detach the final PIB under
> pib_lock and queue only that current object for RCU freeing. This lets all
> driver callbacks finish before the PIB is reclaimed and avoids freeing a
> PIB that was already replaced during teardown.
>
> Reported-by: syzbot+8a8482d4c33cc58babb4@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/6af5f575.b350cda4.2b6a63.0000.GAE@google.com/T/
> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhan Jun <zhanjun@uniontech.com>
> Signed-off-by: Yichong Chen <chenyichong@uniontech.com>

This is a duplicate of:
https://lore.kernel.org/all/20260627235805.17310-1-alhouseenyousef@gmail.com/
https://lore.kernel.org/all/20260709221858.158063-1-devnexen@gmail.com/
https://lore.kernel.org/all/20260919223434.3882824-1-benquike@gmail.com/

Miquèl

      reply	other threads:[~2026-11-17 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 13:41 [PATCH net] ieee802154: hwsim: free PIB after hardware unregister Yichong Chen
2026-11-17 10:17 ` Miquel Raynal [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=87ld6rn4n3.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alex.aring@gmail.com \
    --cc=chenyichong@uniontech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stefan@datenfreihafen.org \
    --cc=syzbot+8a8482d4c33cc58babb4@syzkaller.appspotmail.com \
    --cc=zhanjun@uniontech.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