Re: INFO: task hung in submit_bio_wait

From: Dmitry Vyukov
Date: Tue Dec 12 2017 - 11:50:51 EST


On Sun, Dec 10, 2017 at 2:33 PM, syzbot
<bot+00a24be9a2c585a83f9cf76bb3ac135fce12c346@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
> Hello,
>
> syzkaller hit the following crash on
> ad4dac17f9d563b9e34aab78a34293b10993e9b5
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached
> Raw console output is attached.
>
> Unfortunately, I don't have any reproducer for this bug yet.
>
>
> INFO: task loop0:9647 blocked for more than 120 seconds.
> Not tainted 4.15.0-rc2-next-20171208+ #63
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> loop0 D24776 9647 2 0x80000000
> Call Trace:
> context_switch kernel/sched/core.c:2800 [inline]
> __schedule+0x8eb/0x2060 kernel/sched/core.c:3376
> schedule+0xf5/0x430 kernel/sched/core.c:3435
> schedule_timeout+0x43a/0x560 kernel/time/timer.c:1776
> io_schedule_timeout+0x26/0x80 kernel/sched/core.c:5031
> do_wait_for_common kernel/sched/completion.c:91 [inline]
> __wait_for_common kernel/sched/completion.c:112 [inline]
> wait_for_common_io kernel/sched/completion.c:129 [inline]
> wait_for_completion_io+0x44b/0x7b0 kernel/sched/completion.c:177
> submit_bio_wait+0x1bc/0x290 block/bio.c:945
> blkdev_issue_flush+0x1da/0x2d0 block/blk-flush.c:548
> blkdev_fsync+0x86/0xb0 fs/block_dev.c:632
> vfs_fsync_range+0x110/0x260 fs/sync.c:196
> vfs_fsync+0x29/0x30 fs/sync.c:210
> lo_req_flush drivers/block/loop.c:444 [inline]
> do_req_filebacked drivers/block/loop.c:572 [inline]
> loop_handle_cmd drivers/block/loop.c:1718 [inline]
> loop_queue_work+0x12a2/0x3900 drivers/block/loop.c:1732
> kthread_worker_fn+0x32b/0x980 kernel/kthread.c:642
> loop_kthread_worker_fn+0x51/0x60 drivers/block/loop.c:841
> kthread+0x37a/0x440 kernel/kthread.c:238
> ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:524
>
> Showing all locks held in the system:
> 2 locks held by khungtaskd/671:
> #0: (rcu_read_lock){....}, at: [<00000000dda22052>]
> check_hung_uninterruptible_tasks kernel/hung_task.c:175 [inline]
> #0: (rcu_read_lock){....}, at: [<00000000dda22052>] watchdog+0x1c5/0xd60
> kernel/hung_task.c:249
> #1: (tasklist_lock){.+.+}, at: [<000000000a5489e7>]
> debug_show_all_locks+0xd3/0x400 kernel/locking/lockdep.c:4554
> 1 lock held by rsyslogd/2998:
> #0: (&f->f_pos_lock){+.+.}, at: [<000000008ce496ee>]
> __fdget_pos+0x131/0x1a0 fs/file.c:765
> 2 locks held by getty/3119:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3120:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3121:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3122:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3123:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3124:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3125:
> #0: (&tty->ldisc_sem){++++}, at: [<000000004f4a9ad9>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<000000002779229e>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 1 lock held by syz-executor4/11197:
> #0: (&lo->lo_ctl_mutex/1){+.+.}, at: [<0000000032cef15a>]
> lo_ioctl+0x8b/0x1b90 drivers/block/loop.c:1355
>
> =============================================
>
> NMI backtrace for cpu 1
> CPU: 1 PID: 671 Comm: khungtaskd Not tainted 4.15.0-rc2-next-20171208+ #63
> 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+0x37a/0x440 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 skipped: idling at native_safe_halt+0x6/0x10
> arch/x86/include/asm/irqflags.h:54

+loop maintainers

#syz dup: INFO: task hung in lo_ioctl


> ---
> This bug is generated by a dumb bot. It may contain errors.
> See https://goo.gl/tpsmEJ for details.
> Direct all questions to syzkaller@xxxxxxxxxxxxxxxxx
> Please credit me with: Reported-by: syzbot <syzkaller@xxxxxxxxxxxxxxxx>
>
> syzbot will keep track of this bug report.
> Once a fix for this bug is merged into any tree, reply to this email with:
> #syz fix: exact-commit-title
> To mark this as a duplicate of another syzbot report, please reply with:
> #syz dup: exact-subject-of-another-report
> If it's a one-off invalid bug report, please reply with:
> #syz invalid
> Note: if the crash happens again, it will cause creation of a new bug
> report.
> Note: all commands must start from beginning of the line in the email body.
>
> --
> You received this message because you are subscribed to the Google Groups
> "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to syzkaller-bugs+unsubscribe@xxxxxxxxxxxxxxxxx
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-bugs/f403045fbfa0f383d4055ffc741c%40google.com.
> For more options, visit https://groups.google.com/d/optout.