syzbot


INFO: task hung in snd_pcm_oss_write

Status: fixed on 2018/01/19 01:24
Subsystems: sound
[Documentation on labels]
Reported-by: syzbot+d6e4de2dc1667030324f@syzkaller.appspotmail.com
Fix commit: 29159a4ed704 ALSA: pcm: Abort properly at pending signal in OSS read/write loops
First crash: 2269d, last: 2269d

Sample crash report:
INFO: task syz-executor3:3522 blocked for more than 120 seconds.
      Not tainted 4.15.0-rc7+ #256
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor3   D24272  3522   3509 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2799 [inline]
 __schedule+0x8eb/0x2060 kernel/sched/core.c:3375
 schedule+0xf5/0x430 kernel/sched/core.c:3434
 schedule_preempt_disabled+0x10/0x20 kernel/sched/core.c:3492
 __mutex_lock_common kernel/locking/mutex.c:833 [inline]
 __mutex_lock+0xaad/0x1a80 kernel/locking/mutex.c:893
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1338 [inline]
 snd_pcm_oss_write+0x22d/0x830 sound/core/oss/pcm_oss.c:2646
 do_loop_readv_writev fs/read_write.c:676 [inline]
 do_iter_write+0x3ca/0x540 fs/read_write.c:934
 vfs_writev+0x18a/0x340 fs/read_write.c:977
 do_writev+0xfc/0x2a0 fs/read_write.c:1012
 SYSC_writev fs/read_write.c:1085 [inline]
 SyS_writev+0x27/0x30 fs/read_write.c:1082
 entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x452ac9
RSP: 002b:00007f71e06cbc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000071bf58 RCX: 0000000000452ac9
RDX: 0000000000000005 RSI: 0000000020d30fb0 RDI: 0000000000000000
RBP: 00000000000003aa R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f3890
R13: 00000000ffffffff R14: 00007f71e06cc6d4 R15: 0000000000000000

Showing all locks held in the system:
3 locks held by kworker/u4:1/21:
 #0:  ((wq_completion)"%s""netns"){+.+.}, at: [<000000009d8b7ab1>] process_one_work+0xaaf/0x1b10 kernel/workqueue.c:2083
 #1:  (net_cleanup_work){+.+.}, at: [<0000000057b0e500>] process_one_work+0xb01/0x1b10 kernel/workqueue.c:2087
 #2:  (net_mutex){+.+.}, at: [<00000000272d2639>] cleanup_net+0x247/0xb50 net/core/net_namespace.c:450
2 locks held by khungtaskd/738:
 #0:  (rcu_read_lock){....}, at: [<00000000d3caa368>] check_hung_uninterruptible_tasks kernel/hung_task.c:175 [inline]
 #0:  (rcu_read_lock){....}, at: [<00000000d3caa368>] watchdog+0x1c5/0xd60 kernel/hung_task.c:249
 #1:  (tasklist_lock){.+.+}, at: [<00000000ad265c79>] debug_show_all_locks+0xd3/0x400 kernel/locking/lockdep.c:4464
2 locks held by getty/3465:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
2 locks held by getty/3466:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
2 locks held by getty/3467:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
2 locks held by getty/3468:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
2 locks held by getty/3469:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
2 locks held by getty/3470:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
2 locks held by getty/3471:
 #0:  (&tty->ldisc_sem){++++}, at: [<000000000cbb9a4f>] ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<00000000751be7e4>] n_tty_read+0x2ef/0x1a00 drivers/tty/n_tty.c:2131
1 lock held by syz-executor3/3522:
 #0:  (&runtime->oss.params_lock){+.+.}, at: [<00000000b64538d3>] snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1338 [inline]
 #0:  (&runtime->oss.params_lock){+.+.}, at: [<00000000b64538d3>] snd_pcm_oss_write+0x22d/0x830 sound/core/oss/pcm_oss.c:2646
1 lock held by syz-executor1/3534:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410
1 lock held by syz-executor2/3536:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410
1 lock held by syz-executor7/3538:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410
1 lock held by syz-executor0/3540:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410
1 lock held by syz-executor5/3542:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410
1 lock held by syz-executor6/3543:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410
1 lock held by syz-executor4/3545:
 #0:  (net_mutex){+.+.}, at: [<00000000a3f02c40>] copy_net_ns+0x239/0x580 net/core/net_namespace.c:410

=============================================

NMI backtrace for cpu 1
CPU: 1 PID: 738 Comm: khungtaskd Not tainted 4.15.0-rc7+ #256
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:53
 nmi_cpu_backtrace+0x1d2/0x210 lib/nmi_backtrace.c:103
 nmi_trigger_cpumask_backtrace+0x122/0x180 lib/nmi_backtrace.c:62
 arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
 trigger_all_cpu_backtrace include/linux/nmi.h:138 [inline]
 check_hung_task kernel/hung_task.c:132 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:190 [inline]
 watchdog+0x90c/0xd60 kernel/hung_task.c:249
 kthread+0x33c/0x400 kernel/kthread.c:238
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:524
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 3521 Comm: syz-executor3 Not tainted 4.15.0-rc7+ #256
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:memcpy_erms+0x8/0x10 arch/x86/lib/memcpy_64.S:54
RSP: 0018:ffff8801bfa1f7b0 EFLAGS: 00000246
RAX: ffffc900017899ec RBX: 0000000000000002 RCX: 0000000000000000
RDX: 0000000000000002 RSI: ffff8801bfa1f8a2 RDI: ffffc900017899ee
RBP: ffff8801bfa1f7d0 R08: fffff520002f133e R09: fffff520002f133e
R10: 0000000000000001 R11: fffff520002f133d R12: ffffc900017899ec
R13: ffff8801bfa1f8a0 R14: dffffc0000000000 R15: ffffc900017899ec
FS:  00007f71e06ed700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020e1e000 CR3: 00000001c1252005 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 memcpy include/linux/string.h:344 [inline]
 cvt_s16_to_native sound/core/oss/mulaw.c:164 [inline]
 mulaw_decode+0x52f/0x770 sound/core/oss/mulaw.c:195
 mulaw_transfer+0x222/0x270 sound/core/oss/mulaw.c:273
 snd_pcm_plug_write_transfer+0x22d/0x420 sound/core/oss/pcm_plugin.c:611
 snd_pcm_oss_write2+0x260/0x420 sound/core/oss/pcm_oss.c:1311
 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1372 [inline]
 snd_pcm_oss_write+0x5fe/0x830 sound/core/oss/pcm_oss.c:2646
 do_loop_readv_writev fs/read_write.c:676 [inline]
 do_iter_write+0x3ca/0x540 fs/read_write.c:934
 vfs_writev+0x18a/0x340 fs/read_write.c:977
 do_writev+0xfc/0x2a0 fs/read_write.c:1012
 SYSC_writev fs/read_write.c:1085 [inline]
 SyS_writev+0x27/0x30 fs/read_write.c:1082
 entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x452ac9
RSP: 002b:00007f71e06ecc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9
RDX: 0000000000000005 RSI: 0000000020d30fb0 RDI: 0000000000000000
RBP: 00000000000003cf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f3c08
R13: 00000000ffffffff R14: 00007f71e06ed6d4 R15: 0000000000000000
Code: 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 f3 a4 <c3> 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe 7c 

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/10 21:27 upstream cf1fb158230e 02a19b64 .config console log report syz ci-upstream-kasan-gce
2018/01/10 19:14 upstream cf1fb158230e 02a19b64 .config console log report ci-upstream-kasan-gce
* Struck through repros no longer work on HEAD.