syzbot


INFO: task hung in __x64_sys_io_uring_enter

Status: fixed on 2019/06/23 12:03
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+91ba19608804b5c53ca7@syzkaller.appspotmail.com
Fix commit: b19062a56726 io_uring: fix possible deadlock between io_uring_{enter,register}
First crash: 1999d, last: 1992d
Discussions (1)
Title Replies (including bot) Last reply
INFO: task hung in __x64_sys_io_uring_enter 0 (1) 2019/04/14 16:42

Sample crash report:
INFO: task syz-executor.4:6381 blocked for more than 143 seconds.
      Not tainted 5.1.0-rc5+ #71
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor.4  D28832  6381  15595 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2877 [inline]
 __schedule+0x813/0x1cc0 kernel/sched/core.c:3518
 schedule+0x92/0x180 kernel/sched/core.c:3562
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3620
 __mutex_lock_common kernel/locking/mutex.c:1002 [inline]
 __mutex_lock+0x726/0x1310 kernel/locking/mutex.c:1072
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
 __do_sys_io_uring_enter fs/io_uring.c:2678 [inline]
 __se_sys_io_uring_enter fs/io_uring.c:2637 [inline]
 __x64_sys_io_uring_enter+0x67f/0xac0 fs/io_uring.c:2637
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x458c29
Code: cc 64 48 8b 0c 25 f8 ff ff ff 48 3b 61 10 0f 86 df 00 00 00 48 83 ec 30 48 89 6c 24 28 48 8d 6c 24 28 48 8b 42 08 48 8b 48 70 <48> 89 4c 24 20 48 8b 10 48 89 54 24 18 48 8b 40 08 48 89 44 24 10
RSP: 002b:00007fa483d79c78 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000458c29
RDX: 0000000000000101 RSI: 0000000000000007 RDI: 0000000000000003
RBP: 000000000073bf00 R08: 0000000020000080 R09: 0000000000000008
R10: 0000000000000003 R11: 0000000000000246 R12: 00007fa483d7a6d4
R13: 00000000004bfe3c R14: 00000000004d2120 R15: 00000000ffffffff
INFO: task syz-executor.4:6383 blocked for more than 143 seconds.
      Not tainted 5.1.0-rc5+ #71
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor.4  D30016  6383  15595 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2877 [inline]
 __schedule+0x813/0x1cc0 kernel/sched/core.c:3518
 schedule+0x92/0x180 kernel/sched/core.c:3562
 schedule_timeout+0x8ca/0xfd0 kernel/time/timer.c:1779
 do_wait_for_common kernel/sched/completion.c:83 [inline]
 __wait_for_common kernel/sched/completion.c:104 [inline]
 wait_for_common kernel/sched/completion.c:115 [inline]
 wait_for_completion+0x29c/0x440 kernel/sched/completion.c:136
 __io_uring_register+0xb6/0x1fd0 fs/io_uring.c:2929
 __do_sys_io_uring_register fs/io_uring.c:2979 [inline]
 __se_sys_io_uring_register fs/io_uring.c:2961 [inline]
 __x64_sys_io_uring_register+0x193/0x1f0 fs/io_uring.c:2961
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x458c29
Code: cc 64 48 8b 0c 25 f8 ff ff ff 48 3b 61 10 0f 86 df 00 00 00 48 83 ec 30 48 89 6c 24 28 48 8d 6c 24 28 48 8b 42 08 48 8b 48 70 <48> 89 4c 24 20 48 8b 10 48 89 54 24 18 48 8b 40 08 48 89 44 24 10
RSP: 002b:00007fa483d58c78 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000458c29
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003
RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa483d596d4
R13: 00000000004cb6f0 R14: 00000000004d2168 R15: 00000000ffffffff

Showing all locks held in the system:
1 lock held by khungtaskd/1042:
 #0: 000000002738b46d (rcu_read_lock){....}, at: debug_show_all_locks+0x5f/0x27e kernel/locking/lockdep.c:5056
2 locks held by rs:main Q:Reg/7585:
 #0: 0000000042fe54a7 (&f->f_pos_lock){+.+.}, at: __fdget_pos+0xee/0x110 fs/file.c:801
 #1: 000000002738b46d (rcu_read_lock){....}, at: trace_sched_stat_runtime include/trace/events/sched.h:428 [inline]
 #1: 000000002738b46d (rcu_read_lock){....}, at: update_curr+0x2ce/0x8a0 kernel/sched/fair.c:842
1 lock held by rsyslogd/7587:
2 locks held by getty/7677:
 #0: 00000000421c116d (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 00000000619da5a6 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
2 locks held by getty/7678:
 #0: 00000000eb0d1795 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 00000000381223fb (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
2 locks held by getty/7679:
 #0: 000000000a1bb678 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 000000005ab3c2ae (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
2 locks held by getty/7680:
 #0: 000000008ba938ec (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 00000000a7cb9cec (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
2 locks held by getty/7681:
 #0: 000000009f75b730 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 00000000f36e0750 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
2 locks held by getty/7682:
 #0: 00000000f0e83d44 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 000000009fc3b0a1 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
2 locks held by getty/7683:
 #0: 0000000014bf42fa (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:341
 #1: 000000000b48cfb1 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2156
1 lock held by syz-executor.4/6381:
 #0: 00000000009e6980 (&ctx->uring_lock){+.+.}, at: __do_sys_io_uring_enter fs/io_uring.c:2678 [inline]
 #0: 00000000009e6980 (&ctx->uring_lock){+.+.}, at: __se_sys_io_uring_enter fs/io_uring.c:2637 [inline]
 #0: 00000000009e6980 (&ctx->uring_lock){+.+.}, at: __x64_sys_io_uring_enter+0x67f/0xac0 fs/io_uring.c:2637
1 lock held by syz-executor.4/6383:
 #0: 00000000009e6980 (&ctx->uring_lock){+.+.}, at: __do_sys_io_uring_register fs/io_uring.c:2978 [inline]
 #0: 00000000009e6980 (&ctx->uring_lock){+.+.}, at: __se_sys_io_uring_register fs/io_uring.c:2961 [inline]
 #0: 00000000009e6980 (&ctx->uring_lock){+.+.}, at: __x64_sys_io_uring_register+0x182/0x1f0 fs/io_uring.c:2961

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

NMI backtrace for cpu 0
CPU: 0 PID: 1042 Comm: khungtaskd Not tainted 5.1.0-rc5+ #71
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 nmi_cpu_backtrace.cold+0x63/0xa4 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x1be/0x236 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:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:204 [inline]
 watchdog+0x9b7/0xec0 kernel/hung_task.c:288
 kthread+0x357/0x430 kernel/kthread.c:253
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
Sending NMI from CPU 0 to CPUs 1:

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/04/17 18:30 upstream 444fe9913539 b0e8efcb .config console log report ci-upstream-kasan-gce-smack-root
2019/04/17 09:58 upstream 444fe9913539 b0e8efcb .config console log report ci-upstream-kasan-gce-smack-root
2019/04/16 09:16 upstream 5512320c9f6f 505ab413 .config console log report ci-upstream-kasan-gce-selinux-root
2019/04/15 12:41 upstream dc4060a5dc25 505ab413 .config console log report ci-upstream-kasan-gce-smack-root
2019/04/15 12:02 upstream dc4060a5dc25 505ab413 .config console log report ci-upstream-kasan-gce-smack-root
2019/04/15 12:01 upstream dc4060a5dc25 505ab413 .config console log report ci-upstream-kasan-gce-selinux-root
2019/04/15 07:42 upstream dc4060a5dc25 505ab413 .config console log report ci-upstream-kasan-gce
2019/04/14 23:55 upstream 4443f8e6ac77 505ab413 .config console log report ci-upstream-kasan-gce
2019/04/21 11:56 linux-next 3f018f4a019a b0e8efcb .config console log report ci-upstream-linux-next-kasan-gce-root
2019/04/20 22:42 linux-next 3f018f4a019a b0e8efcb .config console log report ci-upstream-linux-next-kasan-gce-root
2019/04/19 15:52 linux-next 3f018f4a019a b0e8efcb .config console log report ci-upstream-linux-next-kasan-gce-root
2019/04/13 22:45 linux-next bcb67f0fbce9 c402d8f1 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.