syzbot


possible deadlock in br_multicast_rcv

Status: auto-closed as invalid on 2021/09/03 11:13
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 492d, last: 491d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in br_multicast_rcv (2) 11 254d 383d 0/24 auto-closed as invalid on 2022/05/17 09:29

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.13.0-rc3-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.0/3811 is trying to acquire lock:
ffff888070998f90 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
ffff888070998f90 (&br->multicast_lock){+.-.}-{2:2}, at: br_ip6_multicast_query net/bridge/br_multicast.c:2823 [inline]
ffff888070998f90 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_ipv6_rcv net/bridge/br_multicast.c:3210 [inline]
ffff888070998f90 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_rcv+0x2c93/0x56e0 net/bridge/br_multicast.c:3242

but task is already holding lock:
ffff888089b88f90 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
ffff888089b88f90 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_port_query_expired+0x40/0x170 net/bridge/br_multicast.c:1528

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

7 locks held by syz-executor.0/3811:
 #0: ffff8880838debe0 (sk_lock-AF_TIPC){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1610 [inline]
 #0: ffff8880838debe0 (sk_lock-AF_TIPC){+.+.}-{0:0}, at: __tipc_sendstream+0x3a1/0x1150 net/tipc/socket.c:1584
 #1: ffffc90000007d70 ((&port->ip6_own_query.timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline]
 #1: ffffc90000007d70 ((&port->ip6_own_query.timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1421
 #2: ffff888089b88f90 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
 #2: ffff888089b88f90 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_port_query_expired+0x40/0x170 net/bridge/br_multicast.c:1528
 #3: ffffffff8bf76800 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1da/0x2e30 net/core/dev.c:4179
 #4: ffffffff8bf76860 (rcu_read_lock){....}-{1:2}, at: is_netpoll_tx_blocked include/net/bonding.h:109 [inline]
 #4: ffffffff8bf76860 (rcu_read_lock){....}-{1:2}, at: bond_start_xmit+0x88/0x11f0 drivers/net/bonding/bond_main.c:4744
 #5: ffffffff8bf76800 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1da/0x2e30 net/core/dev.c:4179
 #6: ffffffff8bf76860 (rcu_read_lock){....}-{1:2}, at: br_dev_xmit+0x0/0x1690 net/bridge/br_device.c:305

stack backtrace:
CPU: 0 PID: 3811 Comm: syz-executor.0 Not tainted 5.13.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_deadlock_bug kernel/locking/lockdep.c:2831 [inline]
 check_deadlock kernel/locking/lockdep.c:2874 [inline]
 validate_chain kernel/locking/lockdep.c:3663 [inline]
 __lock_acquire.cold+0x22f/0x3b4 kernel/locking/lockdep.c:4902
 lock_acquire kernel/locking/lockdep.c:5512 [inline]
 lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5477
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151
 spin_lock include/linux/spinlock.h:354 [inline]
 br_ip6_multicast_query net/bridge/br_multicast.c:2823 [inline]
 br_multicast_ipv6_rcv net/bridge/br_multicast.c:3210 [inline]
 br_multicast_rcv+0x2c93/0x56e0 net/bridge/br_multicast.c:3242
 br_dev_xmit+0x6fb/0x1690 net/bridge/br_device.c:85
 __netdev_start_xmit include/linux/netdevice.h:4944 [inline]
 netdev_start_xmit include/linux/netdevice.h:4958 [inline]
 xmit_one net/core/dev.c:3654 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3670
 __dev_queue_xmit+0x209c/0x2e30 net/core/dev.c:4245
 bond_dev_queue_xmit+0xc3/0x170 drivers/net/bonding/bond_main.c:304
 bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:4487 [inline]
 __bond_start_xmit drivers/net/bonding/bond_main.c:4721 [inline]
 bond_start_xmit+0x88b/0x11f0 drivers/net/bonding/bond_main.c:4749
 __netdev_start_xmit include/linux/netdevice.h:4944 [inline]
 netdev_start_xmit include/linux/netdevice.h:4958 [inline]
 xmit_one net/core/dev.c:3654 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3670
 __dev_queue_xmit+0x209c/0x2e30 net/core/dev.c:4245
 br_dev_queue_push_xmit+0x252/0x730 net/bridge/br_forward.c:51
 NF_HOOK include/linux/netfilter.h:301 [inline]
 __br_multicast_send_query+0xf80/0x39e0 net/bridge/br_multicast.c:1467
 br_multicast_send_query+0x27c/0x420 net/bridge/br_multicast.c:1512
 br_multicast_port_query_expired+0x118/0x170 net/bridge/br_multicast.c:1536
 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431
 expire_timers kernel/time/timer.c:1476 [inline]
 __run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1745
 __run_timers kernel/time/timer.c:1726 [inline]
 run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758
 __do_softirq+0x29b/0x9f6 kernel/softirq.c:559
 invoke_softirq kernel/softirq.c:433 [inline]
 __irq_exit_rcu+0x136/0x200 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:1100
 </IRQ>
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:647
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:199
Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 8e ad 40 f8 48 89 ef e8 26 26 41 f8 e8 a1 1b 61 f8 fb bf 01 00 00 00 <e8> 76 1c 35 f8 65 8b 05 2f ed e8 76 85 c0 74 02 5d c3 e8 eb 42 e7
RSP: 0018:ffffc90018e67570 EFLAGS: 00000206
RAX: 0000000000002af3 RBX: 0000000000000402 RCX: 1ffffffff2052e3a
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001
RBP: ffff8880b9c35340 R08: 0000000000000001 R09: ffffffff9022b9bf
R10: 0000000000000001 R11: 0000000000000001 R12: ffff8880b9c35340
R13: ffff888070e22080 R14: ffff8880149c0100 R15: ffff88801893e040
 finish_lock_switch kernel/sched/core.c:4093 [inline]
 finish_task_switch.isra.0+0x15d/0x810 kernel/sched/core.c:4210
 context_switch kernel/sched/core.c:4342 [inline]
 __schedule+0x91e/0x23e0 kernel/sched/core.c:5147
 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:5307
 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:35
 __local_bh_enable_ip+0x109/0x120 kernel/softirq.c:391
 spin_unlock_bh include/linux/spinlock.h:399 [inline]
 tipc_sk_rcv+0x8cf/0x1e40 net/tipc/socket.c:2485
 tipc_node_xmit+0x2b0/0xd00 net/tipc/node.c:1694
 __tipc_sendstream+0x843/0x1150 net/tipc/socket.c:1624
 tipc_sendstream+0x4c/0x70 net/tipc/socket.c:1548
 sock_sendmsg_nosec net/socket.c:654 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:674
 sock_write_iter+0x289/0x3c0 net/socket.c:1001
 call_write_iter include/linux/fs.h:2114 [inline]
 new_sync_write+0x426/0x650 fs/read_write.c:518
 vfs_write+0x796/0xa30 fs/read_write.c:605
 ksys_write+0x1ee/0x250 fs/read_write.c:658
 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665d9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd959759188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665d9
RDX: 00000000fffffd6d RSI: 0000000020000100 RDI: 0000000000000004
RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038
R13: 00007ffc61befc5f R14: 00007fd959759300 R15: 0000000000022000

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2021/05/25 14:15 upstream a050a6d2b7e8 3c7fef33 .config log report info possible deadlock in br_multicast_rcv
ci-upstream-kasan-gce-selinux-root 2021/05/24 12:15 upstream c4681547bcce 3c7fef33 .config log report info possible deadlock in br_multicast_rcv
* Struck through repros no longer work on HEAD.