mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+d5dc2801166df6d34774@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [fs?] KASAN: slab-use-after-free Read in lockref_get
Date: Wed, 17 Jul 2024 18:58:49 +0800	[thread overview]
Message-ID: <20240717105849.1208-1-hdanton@sina.com> (raw)
In-Reply-To: <0000000000005c6453061d53bc0f@google.com>

On Mon, 15 Jul 2024 19:02:19 -0700
> syzbot found the following issue on:
> 
> HEAD commit:    58f9416d413a Merge branch 'ice-support-to-dump-phy-config-..
> git tree:       net-next
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16ed24b5980000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git  58f9416d413a

--- x/net/mac80211/debugfs_netdev.c
+++ y/net/mac80211/debugfs_netdev.c
@@ -1016,12 +1016,15 @@ static void ieee80211_debugfs_add_netdev
 
 void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
 {
+	mutex_lock(&sdata->debug_mutex);
 	if (!sdata->vif.debugfs_dir)
-		return;
+		goto out;
 
 	debugfs_remove_recursive(sdata->vif.debugfs_dir);
 	sdata->vif.debugfs_dir = NULL;
 	sdata->debugfs.subdir_stations = NULL;
+out:
+	mutex_unlock(&sdata->debug_mutex);
 }
 
 void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
--- x/net/mac80211/debugfs_sta.c
+++ y/net/mac80211/debugfs_sta.c
@@ -1284,8 +1284,13 @@ void ieee80211_sta_debugfs_add(struct st
 
 void ieee80211_sta_debugfs_remove(struct sta_info *sta)
 {
-	debugfs_remove_recursive(sta->debugfs_dir);
+	struct ieee80211_sub_if_data *sdata = sta->sdata;
+
+	mutex_lock(&sdata->debug_mutex);
+	if (sdata->debugfs.subdir_stations != NULL)
+		debugfs_remove_recursive(sta->debugfs_dir);
 	sta->debugfs_dir = NULL;
+	mutex_unlock(&sdata->debug_mutex);
 }
 
 #undef DEBUGFS_ADD
--- x/net/mac80211/ieee80211_i.h
+++ y/net/mac80211/ieee80211_i.h
@@ -1172,6 +1172,7 @@ struct ieee80211_sub_if_data {
 	u16 desired_active_links;
 
 	u16 restart_active_links;
+	struct mutex  debug_mutex;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
 	struct {
--- x/net/mac80211/iface.c
+++ y/net/mac80211/iface.c
@@ -1091,6 +1091,7 @@ static void ieee80211_set_default_queues
 static void ieee80211_sdata_init(struct ieee80211_local *local,
 				 struct ieee80211_sub_if_data *sdata)
 {
+	mutex_init(&sdata->debug_mutex);
 	sdata->local = local;
 
 	/*
--

  parent reply	other threads:[~2024-07-17 10:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16  2:02 syzbot
2024-07-16 11:20 ` Hillf Danton
2024-07-16 14:04   ` syzbot
2024-07-16 12:48 ` syzbot
2024-07-17  8:31   ` Berg, Benjamin
2024-07-17  3:24 ` Edward Adam Davis
2024-07-17  4:19   ` syzbot
2024-07-17 10:58 ` Hillf Danton [this message]
2024-07-17 11:18   ` syzbot
2024-07-17 11:39 ` Edward Adam Davis
2024-07-17 12:53   ` syzbot
2024-07-17 13:19 ` Edward Adam Davis
2024-07-17 13:38   ` syzbot
2024-07-17 14:07 ` Edward Adam Davis
2024-07-17 21:38   ` syzbot
2024-07-18 10:39 ` Hillf Danton
2024-07-18 14:18   ` syzbot

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=20240717105849.1208-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+d5dc2801166df6d34774@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

all inboxes | Powered by JetHome®