Re: [syzbot] [fs?] KASAN: slab-use-after-free Read in lockref_get
From: Hillf Danton
Date: Tue Jul 16 2024 - 07:26:20 EST
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_sta.c
+++ y/net/mac80211/debugfs_sta.c
@@ -1284,6 +1284,12 @@ void ieee80211_sta_debugfs_add(struct st
void ieee80211_sta_debugfs_remove(struct sta_info *sta)
{
+ struct ieee80211_sub_if_data *sdata = sta->sdata;
+
+ if (!sdata->debugfs.subdir_stations)
+ return;
+ if (!sdata->vif.debugfs_dir)
+ return;
debugfs_remove_recursive(sta->debugfs_dir);
sta->debugfs_dir = NULL;
}
--