WARNING: bad unlock balance in ieee80211_unregister_hw

From: syzbot
Date: Fri Nov 06 2020 - 05:53:27 EST


Hello,

syzbot found the following issue on:

HEAD commit: cb5dc5b0 Merge branch 'bpf: safeguard hashtab locking in N..
git tree: bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=13498a0c500000
kernel config: https://syzkaller.appspot.com/x/.config?x=58a4ca757d776bfe
dashboard link: https://syzkaller.appspot.com/bug?extid=a6e9e84a19d90b996a65
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a6e9e84a19d90b996a65@xxxxxxxxxxxxxxxxxxxxxxxxx

=====================================
WARNING: bad unlock balance detected!
5.9.0-syzkaller #0 Not tainted
-------------------------------------
kworker/u4:3/24893 is trying to release lock ((wq_completion)phy264) at:
[<ffffffff81476be1>] flush_workqueue+0xe1/0x13e0 kernel/workqueue.c:2780
but there are no more locks to release!

other info that might help us debug this:
3 locks held by kworker/u4:3/24893:
#0: ffff8881407aa938 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff8881407aa938 ((wq_completion)netns){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
#0: ffff8881407aa938 ((wq_completion)netns){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
#0: ffff8881407aa938 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
#0: ffff8881407aa938 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
#0: ffff8881407aa938 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2243
#1: ffffc9000218fda8 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2247
#2: ffffffff8c914010 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x9b/0xa00 net/core/net_namespace.c:566

stack backtrace:
CPU: 1 PID: 24893 Comm: kworker/u4:3 Not tainted 5.9.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:118
print_unlock_imbalance_bug include/trace/events/lock.h:58 [inline]
__lock_release kernel/locking/lockdep.c:5126 [inline]
lock_release.cold+0x34/0x4e kernel/locking/lockdep.c:5462
flush_workqueue+0x125/0x13e0 kernel/workqueue.c:2784
drain_workqueue+0x1a5/0x3c0 kernel/workqueue.c:2948
destroy_workqueue+0x71/0x760 kernel/workqueue.c:4372
ieee80211_unregister_hw+0x1a2/0x210 net/mac80211/main.c:1388
mac80211_hwsim_del_radio drivers/net/wireless/mac80211_hwsim.c:3360 [inline]
hwsim_exit_net+0x56b/0xc90 drivers/net/wireless/mac80211_hwsim.c:4115
ops_exit_list+0xb0/0x160 net/core/net_namespace.c:187
cleanup_net+0x4ea/0xa00 net/core/net_namespace.c:604
process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
kthread+0x3af/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
device hsr_slave_1 left promiscuous mode
batman_adv: batadv0: Removing interface: batadv_slave_0
batman_adv: batadv0: Interface deactivated: batadv_slave_1
batman_adv: batadv0: Removing interface: batadv_slave_1
bridge0: port 2(bridge_slave_1) entered disabled state
device bridge_slave_0 left promiscuous mode
bridge0: port 1(bridge_slave_0) entered disabled state
device veth0_macvtap left promiscuous mode


---
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@xxxxxxxxxxxxxxxx.

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