The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [syzbot] [wireless?] memory leak in ieee80211_mesh_csa_beacon
@ 2026-08-23 16:52 syzbot
  2026-08-24  2:42 ` Forwarded: [PATCH] wifi: mac80211: mesh: free pending CSA settings on interface stop syzbot
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2026-08-23 16:52 UTC (permalink / raw)
  To: johannes, linux-kernel, linux-wireless, netdev, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    bd5f485f3f02 Merge tag 'soc-arm-7.3' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16795679580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=82c3db8c83e3e016
dashboard link: https://syzkaller.appspot.com/bug?extid=f5752cd6b94fe38be666
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17913a25580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5cb73cc49d3d/disk-bd5f485f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/dec5db798cfd/vmlinux-bd5f485f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a7a15e3d5e4d/bzImage-bd5f485f.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f5752cd6b94fe38be666@syzkaller.appspotmail.com

2026/08/19 20:15:25 executed programs: 5
BUG: memory leak
unreferenced object 0xffff88810a69b000 (size 1024):
  comm "syz.0.19", pid 5915, jiffies 4294944112
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    d8 23 c0 25 81 88 ff ff 00 00 00 00 00 00 00 00  .#.%............
  backtrace (crc 46b98ecb):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4597 [inline]
    slab_alloc_node mm/slub.c:4917 [inline]
    __kmalloc_cache_noprof+0x359/0x440 mm/slub.c:5485
    _kmalloc_noprof include/linux/slab.h:988 [inline]
    ieee80211_mesh_csa_beacon+0x2e/0x100 net/mac80211/mesh.c:1547
    ieee80211_set_csa_beacon net/mac80211/cfg.c:4674 [inline]
    __ieee80211_channel_switch+0xb22/0xed0 net/mac80211/cfg.c:4795
    rdev_channel_switch net/wireless/rdev-ops.h:1168 [inline]
    nl80211_channel_switch+0x39b/0x780 net/wireless/nl80211.c:12234
    genl_family_rcv_msg_doit+0x12e/0x1a0 net/netlink/genetlink.c:1114
    genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline]
    genl_rcv_msg+0x302/0x440 net/netlink/genetlink.c:1209
    netlink_rcv_skb+0x89/0x1c0 net/netlink/af_netlink.c:2556
    genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218
    netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
    netlink_unicast+0x38f/0x4e0 net/netlink/af_netlink.c:1345
    netlink_sendmsg+0x335/0x690 net/netlink/af_netlink.c:1900
    sock_sendmsg_nosec net/socket.c:800 [inline]
    __sock_sendmsg net/socket.c:815 [inline]
    ____sys_sendmsg+0x54a/0x580 net/socket.c:2709
    ___sys_sendmsg+0x101/0x140 net/socket.c:2763
    __sys_sendmsg+0xcd/0x140 net/socket.c:2795
    do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
    do_syscall_64+0xe9/0x530 arch/x86/entry/syscall_64.c:84
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Forwarded: [PATCH] wifi: mac80211: mesh: free pending CSA settings on interface stop
  2026-08-23 16:52 [syzbot] [wireless?] memory leak in ieee80211_mesh_csa_beacon syzbot
@ 2026-08-24  2:42 ` syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-08-24  2:42 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] wifi: mac80211: mesh: free pending CSA settings on interface stop
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


ifmsh->csa is allocated in ieee80211_mesh_csa_beacon() and normally
freed in ieee80211_mesh_finish_csa() once the channel switch
completes. If the mesh interface is stopped while a channel switch
is still in progress, ifmsh->csa is never freed, leaking the
mesh_csa_settings object.

Free it in ieee80211_stop_mesh(), the same way ifmsh->beacon is
already handled there.

Reported-by: syzbot+f5752cd6b94fe38be666@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f5752cd6b94fe38be666
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 net/mac80211/mesh.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index d4507e4e6ec1..d3fb4478a366 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1201,7 +1201,8 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
 	struct beacon_data *bcn;
-
+	struct mesh_csa_settings *csa;
+ 
 	netif_carrier_off(sdata->dev);
 
 	/* flush STAs and mpaths on this iface */
@@ -1222,6 +1223,13 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 	RCU_INIT_POINTER(ifmsh->beacon, NULL);
 	kfree_rcu(bcn, rcu_head);
 
+	/* free any pending, unfinished channel switch */
+	csa = sdata_dereference(ifmsh->csa, sdata);
+	if (csa) {
+		RCU_INIT_POINTER(ifmsh->csa, NULL);
+		kfree_rcu(csa, rcu_head);
+	}
+
 	/* free all potentially still buffered group-addressed frames */
 	local->total_ps_buffered -= skb_queue_len(&ifmsh->ps.bc_buf);
 	skb_queue_purge(&ifmsh->ps.bc_buf);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-24  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-23 16:52 [syzbot] [wireless?] memory leak in ieee80211_mesh_csa_beacon syzbot
2026-08-24  2:42 ` Forwarded: [PATCH] wifi: mac80211: mesh: free pending CSA settings on interface stop syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox