Re: INFO: task hung in write_cache_pages

From: Dmitry Vyukov
Date: Tue Dec 12 2017 - 11:30:10 EST


On Sun, Dec 10, 2017 at 2:33 PM, syzbot
<bot+476e4a33b7cd414ba53c50de78387d312de05502@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
> Hello,
>
> syzkaller hit the following crash on
> e40fd8d6b4d9f59b160faa1736f78fc07533ff37
> 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.
>
>
> Buffer I/O error on dev loop0, logical block 10, lost async page write
> INFO: task syz-executor1:20627 blocked for more than 120 seconds.
> Not tainted 4.15.0-rc2-next-20171207+ #62
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> syz-executor1 D23352 20627 3384 0x00000004
> 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
> io_schedule+0x1c/0x70 kernel/sched/core.c:5043
> wait_on_page_bit_common mm/filemap.c:1099 [inline]
> __lock_page+0x585/0x740 mm/filemap.c:1272
> lock_page include/linux/pagemap.h:483 [inline]
> write_cache_pages+0xb2b/0x14a0 mm/page-writeback.c:2206
> generic_writepages+0xe9/0x150 mm/page-writeback.c:2325
> blkdev_writepages+0x1d/0x30 fs/block_dev.c:1939
> do_writepages+0xff/0x170 mm/page-writeback.c:2340
> __filemap_fdatawrite_range+0x32f/0x460 mm/filemap.c:444
> __filemap_fdatawrite mm/filemap.c:452 [inline]
> filemap_fdatawrite mm/filemap.c:457 [inline]
> filemap_write_and_wait+0x59/0xd0 mm/filemap.c:616
> __sync_blockdev fs/block_dev.c:448 [inline]
> sync_blockdev.part.27+0x50/0x70 fs/block_dev.c:457
> sync_blockdev fs/block_dev.c:444 [inline]
> set_blocksize+0x140/0x260 fs/block_dev.c:119
> loop_set_fd drivers/block/loop.c:936 [inline]
> lo_ioctl+0xcf1/0x1b90 drivers/block/loop.c:1358
> __blkdev_driver_ioctl block/ioctl.c:303 [inline]
> blkdev_ioctl+0x1759/0x1e00 block/ioctl.c:601
> block_ioctl+0xea/0x130 fs/block_dev.c:1860
> vfs_ioctl fs/ioctl.c:46 [inline]
> do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:686
> SYSC_ioctl fs/ioctl.c:701 [inline]
> SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
> entry_SYSCALL_64_fastpath+0x1f/0x96
> RIP: 0033:0x452a39
> RSP: 002b:00007faa7bbaac58 EFLAGS: 00000212 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00000000007580d8 RCX: 0000000000452a39
> RDX: 0000000000000015 RSI: 0000000000004c00 RDI: 0000000000000014
> RBP: 0000000000000179 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ef3f8
> R13: 00000000ffffffff R14: 00007faa7bbab6d4 R15: 000000000000000e
>
> Showing all locks held in the system:
> 3 locks held by kworker/u4:1/21:
> #0: ((wq_completion)"writeback"){+.+.}, at: [<000000003e18825f>]
> __write_once_size include/linux/compiler.h:212 [inline]
> #0: ((wq_completion)"writeback"){+.+.}, at: [<000000003e18825f>]
> atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
> #0: ((wq_completion)"writeback"){+.+.}, at: [<000000003e18825f>]
> atomic_long_set include/asm-generic/atomic-long.h:57 [inline]
> #0: ((wq_completion)"writeback"){+.+.}, at: [<000000003e18825f>]
> set_work_data kernel/workqueue.c:619 [inline]
> #0: ((wq_completion)"writeback"){+.+.}, at: [<000000003e18825f>]
> set_work_pool_and_clear_pending kernel/workqueue.c:646 [inline]
> #0: ((wq_completion)"writeback"){+.+.}, at: [<000000003e18825f>]
> process_one_work+0xad4/0x1bc0 kernel/workqueue.c:2084
> #1: ((work_completion)(&(&wb->dwork)->work)){+.+.}, at:
> [<000000009ee6c6b7>] process_one_work+0xb2f/0x1bc0 kernel/workqueue.c:2088
> #2: (&type->s_umount_key#25){++++}, at: [<00000000935880a3>]
> trylock_super+0x20/0x100 fs/super.c:395
> 2 locks held by khungtaskd/673:
> #0: (rcu_read_lock){....}, at: [<000000002316dfa5>]
> check_hung_uninterruptible_tasks kernel/hung_task.c:175 [inline]
> #0: (rcu_read_lock){....}, at: [<000000002316dfa5>] watchdog+0x1c5/0xd60
> kernel/hung_task.c:249
> #1: (tasklist_lock){.+.+}, at: [<0000000088a78c0b>]
> debug_show_all_locks+0xd3/0x400 kernel/locking/lockdep.c:4554
> 1 lock held by rsyslogd/2998:
> #0: (&f->f_pos_lock){+.+.}, at: [<000000002d6db5d9>] spin_lock
> include/linux/spinlock.h:315 [inline]
> #0: (&f->f_pos_lock){+.+.}, at: [<000000002d6db5d9>] double_lock_hb
> kernel/futex.c:1498 [inline]
> #0: (&f->f_pos_lock){+.+.}, at: [<000000002d6db5d9>] futex_wake_op
> kernel/futex.c:1636 [inline]
> #0: (&f->f_pos_lock){+.+.}, at: [<000000002d6db5d9>]
> do_futex+0x138f/0x2280 kernel/futex.c:3483
> 2 locks held by getty/3120:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3121:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3122:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3123:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3124:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/3125:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 2 locks held by getty/16271:
> #0: (&tty->ldisc_sem){++++}, at: [<0000000067ed2db8>]
> ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
> #1: (&ldata->atomic_read_lock){+.+.}, at: [<00000000502e5c39>]
> n_tty_read+0x2f2/0x1a10 drivers/tty/n_tty.c:2131
> 1 lock held by syz-executor1/20627:
> #0: (&lo->lo_ctl_mutex/1){+.+.}, at: [<00000000557ff4c8>]
> lo_ioctl+0x8b/0x1b90 drivers/block/loop.c:1355
> 1 lock held by syz-executor1/20636:
> #0: (&lo->lo_ctl_mutex/1){+.+.}, at: [<00000000557ff4c8>]
> lo_ioctl+0x8b/0x1b90 drivers/block/loop.c:1355
> 1 lock held by syz-executor1/20643:
> #0: (&lo->lo_ctl_mutex/1){+.+.}, at: [<00000000557ff4c8>]
> lo_ioctl+0x8b/0x1b90 drivers/block/loop.c:1355
> 1 lock held by blkid/20622:
> #0: (&lo->lo_ctl_mutex/1){+.+.}, at: [<00000000557ff4c8>]
> lo_ioctl+0x8b/0x1b90 drivers/block/loop.c:1355
> 1 lock held by syz-executor2/20632:
> #0: (&bdev->bd_mutex){+.+.}, at: [<00000000f0d4c738>]
> iterate_bdevs+0xc8/0x260 fs/block_dev.c:2145
> 1 lock held by syz-executor2/20656:
> #0: (&bdev->bd_mutex){+.+.}, at: [<00000000f0d4c738>]
> iterate_bdevs+0xc8/0x260 fs/block_dev.c:2145
>
> =============================================
>
> NMI backtrace for cpu 0
> CPU: 0 PID: 673 Comm: khungtaskd Not tainted 4.15.0-rc2-next-20171207+ #62
> 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 0 to CPUs 1:
> NMI backtrace for cpu 1 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/94eb2c19e756f87317055ffc74e2%40google.com.
> For more options, visit https://groups.google.com/d/optout.