Kernel bug: WARNING in ieee80211_tdls_build_mgmt_packet_data
Subsystem: wireless
Status: open

Crash report:
mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5316 at net/mac80211/tdls.c:611 ieee80211_tdls_add_setup_cfm_ies net/mac80211/tdls.c:611 [inline]
WARNING: CPU: 0 PID: 5316 at net/mac80211/tdls.c:611 ieee80211_tdls_add_ies net/mac80211/tdls.c:762 [inline]
WARNING: CPU: 0 PID: 5316 at net/mac80211/tdls.c:611 ieee80211_tdls_build_mgmt_packet_data+0x2e61/0x4010 net/mac80211/tdls.c:984
Modules linked in:
CPU: 0 UID: 0 PID: 5316 Comm: syz-executor256 Not tainted 6.15.0-syzkaller-13655-gbdc7f8c5adad #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:ieee80211_tdls_add_setup_cfm_ies net/mac80211/tdls.c:611 [inline]
RIP: 0010:ieee80211_tdls_add_ies net/mac80211/tdls.c:762 [inline]
RIP: 0010:ieee80211_tdls_build_mgmt_packet_data+0x2e61/0x4010 net/mac80211/tdls.c:984
Code: fc ff df e9 9f fe ff ff e8 0c 18 c8 f6 90 0f 0b 90 e9 91 fe ff ff e8 fe 17 c8 f6 90 0f 0b 90 e9 83 fe ff ff e8 f0 17 c8 f6 90 <0f> 0b 90 e9 75 fe ff ff e8 e2 17 c8 f6 48 c7 c7 b0 de 7b 8f 4c 89
RSP: 0018:ffffc9000cfe7100 EFLAGS: 00010293
RAX: ffffffff8af84430 RBX: ffff888048430d80 RCX: ffff88801e78c880
RDX: 0000000000000000 RSI: ffffffff8db6e2e9 RDI: ffff88801e78c880
RBP: ffffc9000cfe7280 R08: 0000000000000000 R09: 000000000000000c
R10: 000000000000000c R11: 0000000000000000 R12: ffff888048432500
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888036870e40
FS:  000055555af7b380(0000) GS:ffff88808d252000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000021c0 CR3: 0000000044417000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ieee80211_tdls_prep_mgmt_packet+0x3a4/0x820 net/mac80211/tdls.c:1058
 ieee80211_tdls_mgmt+0x32e/0x840 net/mac80211/tdls.c:1299
 rdev_tdls_mgmt net/wireless/rdev-ops.h:927 [inline]
 nl80211_tdls_mgmt+0x4e7/0x770 net/wireless/nl80211.c:12601
 genl_family_rcv_msg_doit+0x212/0x300 net/netlink/genetlink.c:1115
 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
 genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210
 netlink_rcv_skb+0x205/0x470 net/netlink/af_netlink.c:2534
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
 netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339
 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883
 sock_sendmsg_nosec net/socket.c:712 [inline]
 __sock_sendmsg+0x21c/0x270 net/socket.c:727
 ____sys_sendmsg+0x505/0x830 net/socket.c:2566
 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620
 __sys_sendmsg net/socket.c:2652 [inline]
 __do_sys_sendmsg net/socket.c:2657 [inline]
 __se_sys_sendmsg net/socket.c:2655 [inline]
 __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2655
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa440f24be9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 01 1a 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe11bfc7d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fa440f24be9
RDX: 0000000000000000 RSI: 0000200000000000 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffe11bfc840
 </TASK>