public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Moon Hee Lee <moonhee.lee.ca@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	 linux-kernel-mentees@lists.linux.dev, netdev@vger.kernel.org,
	 syzkaller-bugs@googlegroups.com,
	 syzbot+d6ccd49ae046542a0641@syzkaller.appspotmail.com,
	 skhan@linuxfoundation.org, david.hunter.linux@gmail.com
Subject: Re: [PATCH wireless-next] wifi: mac80211: fix use-after-free risk in sta debugfs removal
Date: Thu, 24 Jul 2025 09:18:07 +0200	[thread overview]
Message-ID: <b81013d8f7cccb19ab126aebc7bc442c641d0f4a.camel@sipsolutions.net> (raw)
In-Reply-To: <20250724071555.442634-2-moonhee.lee.ca@gmail.com> (sfid-20250724_091629_457606_AC325110)

On Thu, 2025-07-24 at 00:15 -0700, Moon Hee Lee wrote:
> A NULL pointer dereference may occur in ieee80211_sta_debugfs_remove()
> when debugfs_remove_recursive() is called on a dentry whose inode has
> already been freed. This can happen due to a race between STA teardown
> and debugfs cleanup.
> 
> Fix this by checking that both sta->debugfs_dir and its d_inode are
> valid before invoking debugfs_remove_recursive().
> 
> This avoids the crash reported in syzbot bug:

Maybe so, but it really looks like a bandaid?! Why are we trying to
remove it twice in the first place?

johannes

  reply	other threads:[~2025-07-24  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24  7:15 [PATCH wireless-next] wifi: mac80211: fix use-after-free risk in sta debugfs removal Moon Hee Lee
2025-07-24  7:18 ` Johannes Berg [this message]
2025-07-24  7:48   ` Moon Hee Lee

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=b81013d8f7cccb19ab126aebc7bc442c641d0f4a.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=david.hunter.linux@gmail.com \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=moonhee.lee.ca@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+d6ccd49ae046542a0641@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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