syzbot


possible deadlock in br_multicast_rcv (2)

Status: auto-closed as invalid on 2022/05/17 09:29
Subsystems: bridge
[Documentation on labels]
Reported-by: syzbot+1f749b80a78ec45502f8@syzkaller.appspotmail.com
First crash: 963d, last: 830d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] possible deadlock in br_multicast_rcv (2) 0 (1) 2021/09/10 07:37
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in br_multicast_rcv 1 275d 275d 0/3 auto-obsoleted due to no activity on 2023/11/03 02:43
linux-4.14 possible deadlock in br_multicast_rcv C 1 431d 461d 0/1 upstream: reported C repro on 2023/01/21 00:08
linux-4.19 possible deadlock in br_multicast_rcv C error 1 458d 458d 0/1 upstream: reported C repro on 2023/01/24 01:03
upstream possible deadlock in br_multicast_rcv (3) bridge C done error 53 12h47m 466d 0/26 upstream: reported C repro on 2023/01/16 16:40
upstream possible deadlock in br_multicast_rcv bridge 2 1067d 1068d 0/26 auto-closed as invalid on 2021/09/03 11:13

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.16.0-rc4-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.0/17133 is trying to acquire lock:
ffff888049109330 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff888049109330 (&br->multicast_lock){+.-.}-{2:2}, at: br_ip6_multicast_query net/bridge/br_multicast.c:3341 [inline]
ffff888049109330 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_ipv6_rcv net/bridge/br_multicast.c:3737 [inline]
ffff888049109330 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_rcv+0x16dc/0x6230 net/bridge/br_multicast.c:3792

but task is already holding lock:
ffff8880751c9330 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff8880751c9330 (&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

10 locks held by syz-executor.0/17133:
 #0: ffff88807d461628 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline]
 #0: ffff88807d461628 (&mm->mmap_lock#2){++++}-{3:3}, at: __mm_populate+0x264/0x3e0 mm/gup.c:1581
 #1: ffffc90000dc0d70 ((&pmctx->ip6_own_query.timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline]
 #1: ffffc90000dc0d70 ((&pmctx->ip6_own_query.timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1411
 #2: ffff8880751c9330 (&br->multicast_lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
 #2: ffff8880751c9330 (&br->multicast_lock){+.-.}-{2:2}, at: br_multicast_port_query_expired+0x61/0x360 net/bridge/br_multicast.c:1742
 #3: ffffffff8bb83cc0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3650 net/core/dev.c:4153
 #4: ffffffff8bb83d20 (rcu_read_lock){....}-{1:2}, at: is_netpoll_tx_blocked include/net/bonding.h:109 [inline]
 #4: ffffffff8bb83d20 (rcu_read_lock){....}-{1:2}, at: bond_start_xmit+0x88/0x1220 drivers/net/bonding/bond_main.c:5091
 #5: ffffffff8bb83cc0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3650 net/core/dev.c:4153
 #6: ffffffff8bb83d20 (rcu_read_lock){....}-{1:2}, at: is_netpoll_tx_blocked include/net/bonding.h:109 [inline]
 #6: ffffffff8bb83d20 (rcu_read_lock){....}-{1:2}, at: bond_start_xmit+0x88/0x1220 drivers/net/bonding/bond_main.c:5091
 #7: ffffffff8bb83cc0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3650 net/core/dev.c:4153
 #8: ffffffff8bb83cc0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1e3/0x3650 net/core/dev.c:4153
 #9: ffffffff8bb83d20 (rcu_read_lock){....}-{1:2}, at: br_dev_xmit+0x0/0x16c0 net/bridge/br_device.c:309

stack backtrace:
CPU: 1 PID: 17133 Comm: syz-executor.0 Not tainted 5.16.0-rc4-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: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:4994 [inline]
 netdev_start_xmit include/linux/netdevice.h:5008 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3606
 __dev_queue_xmit+0x299a/0x3650 net/core/dev.c:4229
 vlan_dev_hard_start_xmit+0x1b3/0x670 net/8021q/vlan_dev.c:124
 __netdev_start_xmit include/linux/netdevice.h:4994 [inline]
 netdev_start_xmit include/linux/netdevice.h:5008 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3606
 __dev_queue_xmit+0x299a/0x3650 net/core/dev.c:4229
 bond_dev_queue_xmit+0xc3/0x170 drivers/net/bonding/bond_main.c:304
 bond_do_alb_xmit+0x5c1/0x8a0 drivers/net/bonding/bond_alb.c:1325
 __bond_start_xmit drivers/net/bonding/bond_main.c:5072 [inline]
 bond_start_xmit+0xaad/0x1220 drivers/net/bonding/bond_main.c:5096
 __netdev_start_xmit include/linux/netdevice.h:4994 [inline]
 netdev_start_xmit include/linux/netdevice.h:5008 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3606
 __dev_queue_xmit+0x299a/0x3650 net/core/dev.c:4229
 bond_dev_queue_xmit+0xc3/0x170 drivers/net/bonding/bond_main.c:304
 bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:4834 [inline]
 __bond_start_xmit drivers/net/bonding/bond_main.c:5068 [inline]
 bond_start_xmit+0xb01/0x1220 drivers/net/bonding/bond_main.c:5096
 __netdev_start_xmit include/linux/netdevice.h:4994 [inline]
 netdev_start_xmit include/linux/netdevice.h:5008 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3606
 __dev_queue_xmit+0x299a/0x3650 net/core/dev.c:4229
 br_dev_queue_push_xmit+0x25a/0x740 net/bridge/br_forward.c:53
 NF_HOOK include/linux/netfilter.h:307 [inline]
 __br_multicast_send_query+0x118d/0x3aa0 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+0x675/0xa20 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
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202
Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 6e a1 15 f8 48 89 ef e8 b6 17 16 f8 e8 31 d2 36 f8 fb bf 01 00 00 00 <e8> 06 e0 08 f8 65 8b 05 df 52 bb 76 85 c0 74 02 5d c3 e8 fb 27 b9
RSP: 0018:ffffc9000311f668 EFLAGS: 00000206
RAX: 000000000000c699 RBX: 0000000000000001 RCX: 1ffffffff1ff0d96
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffff8880756528a8 R08: 0000000000000001 R09: ffffffff8ff73a37
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000001 R14: ffffea000142fa80 R15: ffffc9000311f708
 spin_unlock_irq include/linux/spinlock.h:399 [inline]
 shmem_add_to_page_cache+0xeff/0x15d0 mm/shmem.c:746
 shmem_getpage_gfp+0x838/0x22d0 mm/shmem.c:1936
 shmem_fault+0x1b4/0x750 mm/shmem.c:2114
 __do_fault+0x10d/0x4d0 mm/memory.c:3849
 do_read_fault mm/memory.c:4164 [inline]
 do_fault mm/memory.c:4293 [inline]
 handle_pte_fault mm/memory.c:4551 [inline]
 __handle_mm_fault+0x28e8/0x5120 mm/memory.c:4686
 handle_mm_fault+0x1c8/0x790 mm/memory.c:4784
 faultin_page mm/gup.c:939 [inline]
 __get_user_pages+0x522/0xfb0 mm/gup.c:1160
 populate_vma_page_range+0x24d/0x330 mm/gup.c:1492
 __mm_populate+0x1ea/0x3e0 mm/gup.c:1601
 mm_populate include/linux/mm.h:2734 [inline]
 vm_mmap_pgoff+0x20e/0x290 mm/util.c:524
 ksys_mmap_pgoff+0x79/0x5a0 mm/mmap.c:1623
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fb0cb8cce99
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:00007fb0ca221168 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fb0cb9e0030 RCX: 00007fb0cb8cce99
RDX: 0000000000000003 RSI: 0000000000b36000 RDI: 0000000020000000
RBP: 00007fb0cb926ff1 R08: ffffffffffffffff R09: 0000000000000000
R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffda6e381bf R14: 00007fb0ca221300 R15: 0000000000022000
 </TASK>
vcan0: j1939_xtp_rx_abort_one: 0xffff88805687b800: 0x00000: (2) System resources were needed for another task so this connection managed session was terminated.
vcan0: j1939_xtp_rx_abort_one: 0xffff8880457c0c00: 0x00000: (2) System resources were needed for another task so this connection managed session was terminated.
vcan0: j1939_xtp_rx_abort_one: 0xffff88805dac2400: 0x00000: (2) System resources were needed for another task so this connection managed session was terminated.
----------------
Code disassembly (best guess):
   0:	0f 1f 44 00 00       	nopl   0x0(%rax,%rax,1)
   5:	55                   	push   %rbp
   6:	48 8b 74 24 08       	mov    0x8(%rsp),%rsi
   b:	48 89 fd             	mov    %rdi,%rbp
   e:	48 83 c7 18          	add    $0x18,%rdi
  12:	e8 6e a1 15 f8       	callq  0xf815a185
  17:	48 89 ef             	mov    %rbp,%rdi
  1a:	e8 b6 17 16 f8       	callq  0xf81617d5
  1f:	e8 31 d2 36 f8       	callq  0xf836d255
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 06 e0 08 f8       	callq  0xf808e035 <-- trapping instruction
  2f:	65 8b 05 df 52 bb 76 	mov    %gs:0x76bb52df(%rip),%eax        # 0x76bb5315
  36:	85 c0                	test   %eax,%eax
  38:	74 02                	je     0x3c
  3a:	5d                   	pop    %rbp
  3b:	c3                   	retq
  3c:	e8                   	.byte 0xe8
  3d:	fb                   	sti
  3e:	27                   	(bad)
  3f:	b9                   	.byte 0xb9

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/16 09:54 net-old ef8a0f6eab1c 572bcb40 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in br_multicast_rcv
2021/12/11 08:29 net-old ab443c539167 49ca1f59 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in br_multicast_rcv
2021/11/29 11:01 net-old c5c17547b778 63eeac02 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in br_multicast_rcv
2021/11/27 19:15 net-old c5c17547b778 63eeac02 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in br_multicast_rcv
2021/09/06 07:35 net-old 57f780f1c433 d236a457 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in br_multicast_rcv
2022/01/17 09:28 net-next-old fe8152b38d3a 723cfaf0 .config console log report info ci-upstream-net-kasan-gce possible deadlock in br_multicast_rcv
2022/01/17 01:14 net-next-old fe8152b38d3a 723cfaf0 .config console log report info ci-upstream-net-kasan-gce possible deadlock in br_multicast_rcv
2022/01/16 15:37 net-next-old fe8152b38d3a 723cfaf0 .config console log report info ci-upstream-net-kasan-gce possible deadlock in br_multicast_rcv
2022/01/10 17:34 net-next-old 8aaaf2f3af2a ddb0ab8c .config console log report info ci-upstream-net-kasan-gce possible deadlock in br_multicast_rcv
2022/01/10 05:43 net-next-old d5c8725cc913 2ca0d385 .config console log report info ci-upstream-net-kasan-gce possible deadlock in br_multicast_rcv
2022/01/08 05:36 net-next-old 82192cb497f9 2ca0d385 .config console log report info ci-upstream-net-kasan-gce possible deadlock in br_multicast_rcv
* Struck through repros no longer work on HEAD.