============================================
WARNING: possible recursive locking detected
5.16.0-syzkaller #0 Not tainted
--------------------------------------------
kworker/u4:7/26827 is trying to acquire lock:
ffff8880336f13b8 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff8880336f13b8 (&br->multicast_lock){+.-.}-{2:2}, at: br_ip6_multicast_query net/bridge/br_multicast.c:3341 [inline]
ffff8880336f13b8 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_ipv6_rcv net/bridge/br_multicast.c:3737 [inline]
ffff8880336f13b8 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_rcv+0x16dc/0x6230 net/bridge/br_multicast.c:3792
but task is already holding lock:
ffff8880506653b8 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff8880506653b8 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_port_query_expired+0x61/0x360 net/bridge/br_multicast.c:1742
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&br->multicast_lock);
lock(&br->multicast_lock);
*** DEADLOCK ***
May be due to missing lock nesting notation
13 locks held by kworker/u4:7/26827:
#0: ffff8881407ab138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff8881407ab138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff8881407ab138 ((wq_completion)netns){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1198 [inline]
#0: ffff8881407ab138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline]
#0: ffff8881407ab138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline]
#0: ffff8881407ab138 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x896/0x1660 kernel/workqueue.c:2269
#1: ffffc900034d7db0 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1660 kernel/workqueue.c:2273
#2: ffffffff8d306bd0 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x9b/0xb00 net/core/net_namespace.c:557
#3: ffffffff8bd5f150 (kernfs_rwsem){++++}-{3:3}, at: kernfs_drain fs/kernfs/dir.c:486 [inline]
#3: ffffffff8bd5f150 (kernfs_rwsem){++++}-{3:3}, at: __kernfs_remove+0x57e/0xab0 fs/kernfs/dir.c:1351
#4: ffffc90000007d70 ((&pmctx->ip6_own_query.timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline]
#4: ffffc90000007d70 ((&pmctx->ip6_own_query.timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1411
#5: ffff8880506653b8 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#5: ffff8880506653b8 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_port_query_expired+0x61/0x360 net/bridge/br_multicast.c:1742
#6: ffffffff8bb845c0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3660 net/core/dev.c:4040
#7: ffffffff8bb84620 (rcu_read_lock){....}-{1:2}, at: is_netpoll_tx_blocked include/net/bonding.h:109 [inline]
#7: ffffffff8bb84620 (rcu_read_lock){....}-{1:2}, at: bond_start_xmit+0x88/0x1220 drivers/net/bonding/bond_main.c:5132
#8: ffffffff8bb845c0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3660 net/core/dev.c:4040
#9: ffffffff8bb84620 (rcu_read_lock){....}-{1:2}, at: is_netpoll_tx_blocked include/net/bonding.h:109 [inline]
#9: ffffffff8bb84620 (rcu_read_lock){....}-{1:2}, at: bond_start_xmit+0x88/0x1220 drivers/net/bonding/bond_main.c:5132
#10: ffffffff8bb845c0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3660 net/core/dev.c:4040
#11: ffffffff8bb845c0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3660 net/core/dev.c:4040
#12: ffffffff8bb84620 (rcu_read_lock){....}-{1:2}, at: br_dev_xmit+0x0/0x16c0 net/bridge/br_device.c:309
stack backtrace:
CPU: 0 PID: 26827 Comm: kworker/u4:7 Not tainted 5.16.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:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
check_deadlock kernel/locking/lockdep.c:2999 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027
lock_acquire kernel/locking/lockdep.c:5637 [inline]
lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:349 [inline]
br_ip6_multicast_query net/bridge/br_multicast.c:3341 [inline]
br_multicast_ipv6_rcv net/bridge/br_multicast.c:3737 [inline]
br_multicast_rcv+0x16dc/0x6230 net/bridge/br_multicast.c:3792
br_dev_xmit+0x6f6/0x16c0 net/bridge/br_device.c:89
__netdev_start_xmit include/linux/netdevice.h:4682 [inline]
netdev_start_xmit include/linux/netdevice.h:4696 [inline]
xmit_one net/core/dev.c:3473 [inline]
dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489
__dev_queue_xmit+0x2985/0x3660 net/core/dev.c:4116
vlan_dev_hard_start_xmit+0x1b3/0x670 net/8021q/vlan_dev.c:124
__netdev_start_xmit include/linux/netdevice.h:4682 [inline]
netdev_start_xmit include/linux/netdevice.h:4696 [inline]
xmit_one net/core/dev.c:3473 [inline]
dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489
__dev_queue_xmit+0x2985/0x3660 net/core/dev.c:4116
bond_dev_queue_xmit+0xc3/0x170 drivers/net/bonding/bond_main.c:306
bond_do_alb_xmit+0x5c1/0x8a0 drivers/net/bonding/bond_alb.c:1325
__bond_start_xmit drivers/net/bonding/bond_main.c:5113 [inline]
bond_start_xmit+0xaad/0x1220 drivers/net/bonding/bond_main.c:5137
__netdev_start_xmit include/linux/netdevice.h:4682 [inline]
netdev_start_xmit include/linux/netdevice.h:4696 [inline]
xmit_one net/core/dev.c:3473 [inline]
dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489
__dev_queue_xmit+0x2985/0x3660 net/core/dev.c:4116
bond_dev_queue_xmit+0xc3/0x170 drivers/net/bonding/bond_main.c:306
bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:4875 [inline]
__bond_start_xmit drivers/net/bonding/bond_main.c:5109 [inline]
bond_start_xmit+0xb01/0x1220 drivers/net/bonding/bond_main.c:5137
__netdev_start_xmit include/linux/netdevice.h:4682 [inline]
netdev_start_xmit include/linux/netdevice.h:4696 [inline]
xmit_one net/core/dev.c:3473 [inline]
dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489
__dev_queue_xmit+0x2985/0x3660 net/core/dev.c:4116
br_dev_queue_push_xmit+0x25c/0x740 net/bridge/br_forward.c:53
NF_HOOK include/linux/netfilter.h:307 [inline]
__br_multicast_send_query+0x118d/0x3ab0 net/bridge/br_multicast.c:1646
br_multicast_send_query+0x266/0x4b0 net/bridge/br_multicast.c:1725
br_multicast_port_query_expired+0x2c3/0x360 net/bridge/br_multicast.c:1750
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734
__run_timers kernel/time/timer.c:1715 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:arch_atomic_read arch/x86/include/asm/atomic.h:29 [inline]
RIP: 0010:atomic_read include/linux/atomic/atomic-instrumented.h:28 [inline]
RIP: 0010:kernfs_put.part.0+0xaf/0x540 fs/kernfs/dir.c:523
Code: 48 c7 c0 40 b3 5b 90 48 c1 e8 03 48 01 d8 48 89 44 24 18 e8 d3 85 82 ff 49 8d 6c 24 04 be 04 00 00 00 48 89 ef e8 c1 e7 c9 ff <48> 89 e8 48 c1 e8 03 0f b6 14 18 48 89 e8 83 e0 07 83 c0 03 38 d0
RSP: 0000:ffffc900034d78b8 EFLAGS: 00000246
RAX: 0000000000000001 RBX: dffffc0000000000 RCX: ffffffff81f4f12f
RDX: ffffed10067e9c58 RSI: 0000000000000004 RDI: ffff888033f4e2bc
RBP: ffff888033f4e2bc R08: 0000000000000000 R09: ffff888033f4e2bf
R10: ffffed10067e9c57 R11: 0000000000000000 R12: ffff888033f4e2b8
R13: ffff888030a263a0 R14: dffffc0000000000 R15: 0000000000000002
kernfs_put+0x42/0x50 fs/kernfs/dir.c:513
__kernfs_remove+0x725/0xab0 fs/kernfs/dir.c:1372
kernfs_remove_by_name_ns+0x4f/0xa0 fs/kernfs/dir.c:1544
kernfs_remove_by_name include/linux/kernfs.h:570 [inline]
remove_files+0x96/0x1c0 fs/sysfs/group.c:28
sysfs_remove_group+0x87/0x170 fs/sysfs/group.c:288
sysfs_remove_groups fs/sysfs/group.c:312 [inline]
sysfs_remove_groups+0x5c/0xa0 fs/sysfs/group.c:304
destroy_gid_attrs drivers/infiniband/core/sysfs.c:1188 [inline]
ib_free_port_attrs+0x1dd/0x460 drivers/infiniband/core/sysfs.c:1408
remove_one_compat_dev drivers/infiniband/core/device.c:1001 [inline]
rdma_dev_exit_net+0x2b2/0x550 drivers/infiniband/core/device.c:1139
ops_exit_list+0xb0/0x160 net/core/net_namespace.c:168
cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:595
process_one_work+0x9b2/0x1660 kernel/workqueue.c:2298
worker_thread+0x65d/0x1130 kernel/workqueue.c:2445
kthread+0x405/0x4f0 kernel/kthread.c:327
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
----------------
Code disassembly (best guess):
0: 48 c7 c0 40 b3 5b 90 mov $0xffffffff905bb340,%rax
7: 48 c1 e8 03 shr $0x3,%rax
b: 48 01 d8 add %rbx,%rax
e: 48 89 44 24 18 mov %rax,0x18(%rsp)
13: e8 d3 85 82 ff callq 0xff8285eb
18: 49 8d 6c 24 04 lea 0x4(%r12),%rbp
1d: be 04 00 00 00 mov $0x4,%esi
22: 48 89 ef mov %rbp,%rdi
25: e8 c1 e7 c9 ff callq 0xffc9e7eb
* 2a: 48 89 e8 mov %rbp,%rax <-- trapping instruction
2d: 48 c1 e8 03 shr $0x3,%rax
31: 0f b6 14 18 movzbl (%rax,%rbx,1),%edx
35: 48 89 e8 mov %rbp,%rax
38: 83 e0 07 and $0x7,%eax
3b: 83 c0 03 add $0x3,%eax
3e: 38 d0 cmp %dl,%al