syzbot


INFO: rcu detected stall in snd_seq_write (2)
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+bb950e68b400ab4f65f8@syzkaller.appspotmail.com
Fix commit: 6fadb494a638 ALSA: seq: Set upper limit of processed events
First crash: 247d, last: 195d

Cause bisection: introduced by (bisect log) :
commit 1a7243ca4074beed97b68d7235a6e34862fc2cd6
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue Nov 10 11:38:47 2020 +0000

  kthread: Move prio/affinite change into the newly created thread

Crash: INFO: rcu detected stall in snd_seq_write (log)
Repro: syz .config
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: rcu detected stall in snd_seq_write syz error 18 1038d 1369d 13/22 fixed on 2019/08/14 02:14
linux-4.19 INFO: rcu detected stall in snd_seq_write 1 897d 897d 0/1 auto-closed as invalid on 2020/04/10 16:27

Sample crash report:
rcu: INFO: rcu_preempt self-detected stall on CPU
rcu: 	1-....: (1 GPs behind) idle=9f5/1/0x4000000000000000 softirq=16474/16475 fqs=4916 
	(t=10500 jiffies g=19249 q=192515)
NMI backtrace for cpu 1
CPU: 1 PID: 13283 Comm: syz-executor.4 Not tainted 5.15.0-rc7-next-20211029-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
 nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:105
 nmi_trigger_cpumask_backtrace+0x1ae/0x220 lib/nmi_backtrace.c:62
 trigger_single_cpu_backtrace include/linux/nmi.h:164 [inline]
 rcu_dump_cpu_stacks+0x25e/0x3f0 kernel/rcu/tree_stall.h:343
 print_cpu_stall kernel/rcu/tree_stall.h:604 [inline]
 check_cpu_stall kernel/rcu/tree_stall.h:688 [inline]
 rcu_pending kernel/rcu/tree.c:3922 [inline]
 rcu_sched_clock_irq.cold+0x9d/0x746 kernel/rcu/tree.c:2620
 update_process_times+0x16d/0x200 kernel/time/timer.c:1785
 tick_sched_handle+0x9b/0x180 kernel/time/tick-sched.c:226
 tick_sched_timer+0x1b0/0x2d0 kernel/time/tick-sched.c:1428
 __run_hrtimer kernel/time/hrtimer.c:1685 [inline]
 __hrtimer_run_queues+0x1c0/0xe50 kernel/time/hrtimer.c:1749
 hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline]
 __sysvec_apic_timer_interrupt+0x146/0x530 arch/x86/kernel/apic/apic.c:1103
 sysvec_apic_timer_interrupt+0x8e/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_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194
Code: 74 24 10 e8 fa 8e 42 f8 48 89 ef e8 42 05 43 f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 <e8> e3 cd 35 f8 65 8b 05 5c 26 e8 76 85 c0 74 0a 5b 5d c3 e8 40 c8
RSP: 0018:ffffc9000d36faf0 EFLAGS: 00000206
RAX: 0000000000000002 RBX: 0000000000000200 RCX: 1ffffffff1f54946
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffff888061a6c498 R08: 0000000000000001 R09: ffffffff8fa48af7
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000293 R14: ffff888061a6c498 R15: 0000000000000000
 spin_unlock_irqrestore include/linux/spinlock.h:422 [inline]
 snd_seq_prioq_cell_out+0x1dc/0x360 sound/core/seq/seq_prioq.c:238
 snd_seq_check_queue+0x1a6/0x3f0 sound/core/seq/seq_queue.c:262
 snd_seq_enqueue_event+0x1ed/0x3e0 sound/core/seq/seq_queue.c:334
 snd_seq_client_enqueue_event.constprop.0+0x230/0x440 sound/core/seq/seq_clientmgr.c:976
 snd_seq_write+0x388/0x690 sound/core/seq/seq_clientmgr.c:1096
 vfs_write+0x28e/0xae0 fs/read_write.c:588
 ksys_write+0x1ee/0x250 fs/read_write.c:643
 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:0x7f4c1777bae9
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:00007f4c16ed0188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f4c1788f020 RCX: 00007f4c1777bae9
RDX: 00000000fffffee4 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007f4c177d5f25 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff0d94d1bf R14: 00007f4c16ed0300 R15: 0000000000022000
 </TASK>
----------------
Code disassembly (best guess):
   0:	74 24                	je     0x26
   2:	10 e8                	adc    %ch,%al
   4:	fa                   	cli
   5:	8e 42 f8             	mov    -0x8(%rdx),%es
   8:	48 89 ef             	mov    %rbp,%rdi
   b:	e8 42 05 43 f8       	callq  0xf8430552
  10:	81 e3 00 02 00 00    	and    $0x200,%ebx
  16:	75 25                	jne    0x3d
  18:	9c                   	pushfq
  19:	58                   	pop    %rax
  1a:	f6 c4 02             	test   $0x2,%ah
  1d:	75 2d                	jne    0x4c
  1f:	48 85 db             	test   %rbx,%rbx
  22:	74 01                	je     0x25
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 e3 cd 35 f8       	callq  0xf835ce12 <-- trapping instruction
  2f:	65 8b 05 5c 26 e8 76 	mov    %gs:0x76e8265c(%rip),%eax        # 0x76e82692
  36:	85 c0                	test   %eax,%eax
  38:	74 0a                	je     0x44
  3a:	5b                   	pop    %rbx
  3b:	5d                   	pop    %rbp
  3c:	c3                   	retq
  3d:	e8                   	.byte 0xe8
  3e:	40                   	rex
  3f:	c8                   	.byte 0xc8

Crashes (21):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2021/10/31 03:11 linux-next bdcc9f6a5682 098b5d53 .config log report syz INFO: rcu detected stall in snd_seq_write
ci-upstream-kasan-gce 2021/11/08 23:06 upstream e851dfae4371 d29682f1 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-kasan-gce-smack-root 2021/11/08 19:27 upstream e851dfae4371 d29682f1 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-kasan-gce-smack-root 2021/11/08 13:18 upstream 6b75d88fa81b d29682f1 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-kasan-gce-386 2021/11/13 01:40 upstream 5833291ab6de 83f5c9b5 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/11/05 12:16 linux-next b477ae38e815 4c1be0be .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/11/03 17:56 linux-next 8ccbda2840b7 4c1be0be .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/11/03 16:20 linux-next 8ccbda2840b7 4c1be0be .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/11/01 11:17 linux-next bdcc9f6a5682 098b5d53 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/10/30 23:52 linux-next bdcc9f6a5682 098b5d53 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/10/27 13:45 linux-next ae5179317e79 373bf66b .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/10/25 05:52 linux-next cf6c9d12750c 4f0000ee .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/10/21 11:05 linux-next 3196a52aff93 f111d03b .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/10/18 23:56 linux-next 60e8840126bd 24dc29db .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/10/14 22:06 linux-next 8006b911c90a 7aa5fe41 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/09/28 06:00 linux-next bf5b1e621a51 78494d16 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/09/26 22:36 linux-next 5a5d008887b4 78494d16 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/09/26 22:20 linux-next 5a5d008887b4 78494d16 .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/09/26 15:40 linux-next 5a5d008887b4 8cac236e .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/09/26 09:20 linux-next 5a5d008887b4 8cac236e .config log report info INFO: rcu detected stall in snd_seq_write
ci-upstream-linux-next-kasan-gce-root 2021/09/22 08:19 linux-next e90f9946ba28 169724fe .config log report info INFO: rcu detected stall in snd_seq_write