syzbot


possible deadlock in hsr_dev_xmit (2)

Status: upstream: reported on 2025/03/07 21:20
Reported-by: syzbot+e98fe00f1b0b8f929db5@syzkaller.appspotmail.com
First crash: 108d, last: 6d04h
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in hsr_dev_xmit 5 351d 404d 0/3 auto-obsoleted due to no activity on 2024/10/15 17:23
linux-6.1 possible deadlock in hsr_dev_xmit 1 381d 381d 0/3 auto-obsoleted due to no activity on 2024/09/16 01:23
upstream possible deadlock in hsr_dev_xmit (2) net C done 868 6h48m 452d 0/29 upstream: reported C repro on 2024/03/28 14:20
upstream possible deadlock in hsr_dev_xmit net 1 817d 813d 0/29 auto-obsoleted due to no activity on 2023/07/27 11:35
linux-6.1 possible deadlock in hsr_dev_xmit (2) origin:upstream C error 4 54d 249d 0/3 upstream: reported C repro on 2024/10/18 06:52

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.15.185-syzkaller #0 Not tainted
--------------------------------------------
kworker/1:1H/1091 is trying to acquire lock:
ffff8880753ced88 (&hsr->seqnr_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:368 [inline]
ffff8880753ced88 (&hsr->seqnr_lock){+.-.}-{2:2}, at: hsr_dev_xmit+0x130/0x1d0 net/hsr/hsr_device.c:222

but task is already holding lock:
ffff888077964d88 (&hsr->seqnr_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:368 [inline]
ffff888077964d88 (&hsr->seqnr_lock){+.-.}-{2:2}, at: hsr_dev_xmit+0x130/0x1d0 net/hsr/hsr_device.c:222

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&hsr->seqnr_lock);
  lock(&hsr->seqnr_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

11 locks held by kworker/1:1H/1091:
 #0: ffff888016870d38 ((wq_completion)events_highpri){+.+.}-{0:0}, at: process_one_work+0x760/0x1000 kernel/workqueue.c:-1
 #1: ffffc90005427d00 ((work_completion)(&vmidi->output_work)){+.+.}-{0:0}, at: process_one_work+0x7a3/0x1000 kernel/workqueue.c:2285
 #2: ffffc90000dd0be0 ((&ndev->rs_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:45 [inline]
 #2: ffffc90000dd0be0 ((&ndev->rs_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbb/0x530 kernel/time/timer.c:1441
 #3: ffffffff8c11bfa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
 #4: ffffffff8c11c000 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312
 #5: ffffffff8c11c000 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312
 #6: ffff888077964d88 (&hsr->seqnr_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:368 [inline]
 #6: ffff888077964d88 (&hsr->seqnr_lock){+.-.}-{2:2}, at: hsr_dev_xmit+0x130/0x1d0 net/hsr/hsr_device.c:222
 #7: ffffffff8c11bfa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
 #8: ffffffff8c11c000 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312
 #9: ffffffff8c11bfa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
 #10: ffffffff8c11c000 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312

stack backtrace:
CPU: 1 PID: 1091 Comm: kworker/1:1H Not tainted 5.15.185-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: events_highpri snd_vmidi_output_work
Call Trace:
 <IRQ>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 __lock_acquire+0x1227/0x7c60 kernel/locking/lockdep.c:-1
 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
 _raw_spin_lock_bh+0x32/0x50 kernel/locking/spinlock.c:178
 spin_lock_bh include/linux/spinlock.h:368 [inline]
 hsr_dev_xmit+0x130/0x1d0 net/hsr/hsr_device.c:222
 __netdev_start_xmit include/linux/netdevice.h:5027 [inline]
 netdev_start_xmit include/linux/netdevice.h:5041 [inline]
 xmit_one net/core/dev.c:3649 [inline]
 dev_hard_start_xmit+0x2a5/0x7e0 net/core/dev.c:3665
 __dev_queue_xmit+0x19df/0x2ed0 net/core/dev.c:4288
 br_dev_queue_push_xmit+0x685/0x820 net/bridge/br_forward.c:53
 NF_HOOK+0x2e0/0x370 include/linux/netfilter.h:302
 br_forward_finish+0x74/0x80 net/bridge/br_forward.c:66
 NF_HOOK+0x2e0/0x370 include/linux/netfilter.h:302
 __br_forward+0x41f/0x600 net/bridge/br_forward.c:115
 deliver_clone net/bridge/br_forward.c:131 [inline]
 maybe_deliver+0xb5/0x150 net/bridge/br_forward.c:189
 br_flood+0x2fc/0x450 net/bridge/br_forward.c:231
 br_dev_xmit+0xee3/0x1400 net/bridge/br_device.c:-1
 __netdev_start_xmit include/linux/netdevice.h:5027 [inline]
 netdev_start_xmit include/linux/netdevice.h:5041 [inline]
 xmit_one net/core/dev.c:3649 [inline]
 dev_hard_start_xmit+0x2a5/0x7e0 net/core/dev.c:3665
 __dev_queue_xmit+0x19df/0x2ed0 net/core/dev.c:4288
 hsr_xmit net/hsr/hsr_forward.c:338 [inline]
 hsr_forward_do net/hsr/hsr_forward.c:429 [inline]
 hsr_forward_skb+0xfb4/0x16e0 net/hsr/hsr_forward.c:582
 hsr_dev_xmit+0x13b/0x1d0 net/hsr/hsr_device.c:223
 __netdev_start_xmit include/linux/netdevice.h:5027 [inline]
 netdev_start_xmit include/linux/netdevice.h:5041 [inline]
 xmit_one net/core/dev.c:3649 [inline]
 dev_hard_start_xmit+0x2a5/0x7e0 net/core/dev.c:3665
 __dev_queue_xmit+0x19df/0x2ed0 net/core/dev.c:4288
 neigh_output include/net/neighbour.h:509 [inline]
 ip6_finish_output2+0x1070/0x1500 net/ipv6/ip6_output.c:130
 dst_output include/net/dst.h:452 [inline]
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ndisc_send_skb+0xbea/0x14a0 net/ipv6/ndisc.c:513
 addrconf_rs_timer+0x2b8/0x600 net/ipv6/addrconf.c:3962
 call_timer_fn+0x16c/0x530 kernel/time/timer.c:1451
 expire_timers kernel/time/timer.c:1496 [inline]
 __run_timers+0x525/0x7c0 kernel/time/timer.c:1767
 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780
 handle_softirqs+0x328/0x820 kernel/softirq.c:576
 __do_softirq kernel/softirq.c:610 [inline]
 invoke_softirq kernel/softirq.c:450 [inline]
 __irq_exit_rcu+0x12f/0x220 kernel/softirq.c:659
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:671
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
 sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:finish_lock_switch+0x134/0x280 kernel/sched/core.c:4785
Code: be ff ff ff ff e8 2c 0e 4e 08 85 c0 74 4a 4d 85 ff 75 66 e9 fe 00 00 00 48 89 df e8 26 6a 57 08 e8 21 7f 2a 00 fb 48 83 c4 08 <5b> 41 5c 41 5d 41 5e 41 5f 5d c3 48 89 df e8 99 10 fe ff 43 80 3c
RSP: 0018:ffffc900054276c8 EFLAGS: 00000282
RAX: 9082f80ab2ada900 RBX: ffff8880b903a300 RCX: 9082f80ab2ada900
RDX: dffffc0000000000 RSI: ffffffff8a0b11c0 RDI: ffffffff8a59a740
RBP: 1ffff1101722760b R08: dffffc0000000000 R09: fffffbfff1ff363d
R10: fffffbfff1ff363d R11: 1ffffffff1ff363c R12: ffff8880b913b048
R13: dffffc0000000000 R14: ffff8880b913adc8 R15: 0000000000000000
 finish_task_switch+0x12f/0x640 kernel/sched/core.c:4902
 context_switch kernel/sched/core.c:5033 [inline]
 __schedule+0x11c0/0x43b0 kernel/sched/core.c:6376
 preempt_schedule_common+0x82/0xd0 kernel/sched/core.c:6552
 preempt_schedule+0xa7/0xb0 kernel/sched/core.c:6577
 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
 _raw_spin_unlock_irqrestore+0xf6/0x100 kernel/locking/spinlock.c:194
 spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
 snd_rawmidi_transmit+0x349/0x400 sound/core/rawmidi.c:1417
 snd_vmidi_output_work+0x1a0/0x400 sound/core/seq/seq_virmidi.c:151
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>
----------------
Code disassembly (best guess):
   0:	be ff ff ff ff       	mov    $0xffffffff,%esi
   5:	e8 2c 0e 4e 08       	call   0x84e0e36
   a:	85 c0                	test   %eax,%eax
   c:	74 4a                	je     0x58
   e:	4d 85 ff             	test   %r15,%r15
  11:	75 66                	jne    0x79
  13:	e9 fe 00 00 00       	jmp    0x116
  18:	48 89 df             	mov    %rbx,%rdi
  1b:	e8 26 6a 57 08       	call   0x8576a46
  20:	e8 21 7f 2a 00       	call   0x2a7f46
  25:	fb                   	sti
  26:	48 83 c4 08          	add    $0x8,%rsp
* 2a:	5b                   	pop    %rbx <-- trapping instruction
  2b:	41 5c                	pop    %r12
  2d:	41 5d                	pop    %r13
  2f:	41 5e                	pop    %r14
  31:	41 5f                	pop    %r15
  33:	5d                   	pop    %rbp
  34:	c3                   	ret
  35:	48 89 df             	mov    %rbx,%rdi
  38:	e8 99 10 fe ff       	call   0xfffe10d6
  3d:	43                   	rex.XB
  3e:	80                   	.byte 0x80
  3f:	3c                   	.byte 0x3c

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/18 06:29 linux-5.15.y 1c700860e8bc e77fae15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hsr_dev_xmit
2025/06/18 06:28 linux-5.15.y 1c700860e8bc e77fae15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hsr_dev_xmit
2025/03/14 21:11 linux-5.15.y 0c935c049b5c e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hsr_dev_xmit
2025/03/07 21:19 linux-5.15.y c16c81c81336 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hsr_dev_xmit
* Struck through repros no longer work on HEAD.