syzbot


INFO: task hung in extent_writepages

Status: upstream: reported on 2024/05/08 07:03
Reported-by: syzbot+0edec97573a554ba29a6@syzkaller.appspotmail.com
First crash: 12d, last: 12d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in extent_writepages btrfs C inconclusive done 30 103d 291d 0/26 auto-obsoleted due to no activity on 2024/05/17 02:53
linux-5.15 INFO: task hung in extent_writepages 1 392d 392d 0/3 auto-obsoleted due to no activity on 2023/08/22 08:46
linux-5.15 INFO: task hung in extent_writepages (2) 1 10d 10d 0/3 upstream: reported on 2024/05/10 00:52

Sample crash report:
INFO: task kworker/u4:4:56 blocked for more than 143 seconds.
      Not tainted 6.1.90-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:4    state:D stack:21024 pid:56    ppid:2      flags:0x00004000
Workqueue: writeback wb_workfn (flush-btrfs-75)
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5245 [inline]
 __schedule+0x142d/0x4550 kernel/sched/core.c:6558
 schedule+0xbf/0x180 kernel/sched/core.c:6634
 io_schedule+0x88/0x100 kernel/sched/core.c:8786
 folio_wait_bit_common+0x878/0x1290 mm/filemap.c:1296
 extent_write_cache_pages fs/btrfs/extent_io.c:3176 [inline]
 extent_writepages+0x8de/0x17a0 fs/btrfs/extent_io.c:3318
 do_writepages+0x3a2/0x670 mm/page-writeback.c:2469
 __writeback_single_inode+0x15d/0x11e0 fs/fs-writeback.c:1612
 writeback_sb_inodes+0xc2b/0x1b20 fs/fs-writeback.c:1903
 __writeback_inodes_wb+0x114/0x400 fs/fs-writeback.c:1974
 wb_writeback+0x4b1/0xe10 fs/fs-writeback.c:2079
 wb_check_background_flush fs/fs-writeback.c:2145 [inline]
 wb_do_writeback fs/fs-writeback.c:2233 [inline]
 wb_workfn+0xc9e/0x1020 fs/fs-writeback.c:2260
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
 </TASK>
INFO: task syz-executor.1:8197 blocked for more than 143 seconds.
      Not tainted 6.1.90-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.1  state:D stack:24696 pid:8197  ppid:7310   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5245 [inline]
 __schedule+0x142d/0x4550 kernel/sched/core.c:6558
 schedule+0xbf/0x180 kernel/sched/core.c:6634
 wait_on_state fs/btrfs/extent-io-tree.c:709 [inline]
 wait_extent_bit+0x423/0x570 fs/btrfs/extent-io-tree.c:742
 lock_extent+0x17a/0x200 fs/btrfs/extent-io-tree.c:1657
 find_lock_delalloc_range+0x4bf/0x970 fs/btrfs/extent_io.c:464
 writepage_delalloc+0x1ed/0x580 fs/btrfs/extent_io.c:1970
 __extent_writepage+0x6e3/0x1730 fs/btrfs/extent_io.c:2281
 extent_write_cache_pages fs/btrfs/extent_io.c:3196 [inline]
 extent_writepages+0xbe0/0x17a0 fs/btrfs/extent_io.c:3318
 do_writepages+0x3a2/0x670 mm/page-writeback.c:2469
 filemap_fdatawrite_wbc+0x121/0x180 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 __filemap_fdatawrite mm/filemap.c:427 [inline]
 filemap_flush+0x11a/0x170 mm/filemap.c:454
 btrfs_release_file+0x102/0x120 fs/btrfs/file.c:1719
 __fput+0x3b7/0x890 fs/file_table.c:320
 task_work_run+0x246/0x300 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303
 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f15d9e7cc5a
RSP: 002b:00007ffe22923be0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f15d9e7cc5a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 00007f15d9fad980 R08: 0000001b33f20000 R09: 00000000000000a2
R10: 00000000818e5ae0 R11: 0000000000000293 R12: 000000000003c023
R13: 00007f15d9fac05c R14: 00007ffe22923ce0 R15: 0000000000000032
 </TASK>
INFO: task syz-executor.1:8198 blocked for more than 144 seconds.
      Not tainted 6.1.90-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.1  state:D stack:23416 pid:8198  ppid:7310   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5245 [inline]
 __schedule+0x142d/0x4550 kernel/sched/core.c:6558
 schedule+0xbf/0x180 kernel/sched/core.c:6634
 wait_on_state fs/btrfs/extent-io-tree.c:709 [inline]
 wait_extent_bit+0x423/0x570 fs/btrfs/extent-io-tree.c:742
 lock_extent+0x17a/0x200 fs/btrfs/extent-io-tree.c:1657
 btrfs_lock_and_flush_ordered_range+0xcf/0x220 fs/btrfs/ordered-data.c:1049
 contiguous_readpages fs/btrfs/extent_io.c:1936 [inline]
 extent_readahead+0x11c1/0x1570 fs/btrfs/extent_io.c:3336
 read_pages+0x17f/0x830 mm/readahead.c:161
 page_cache_ra_unbounded+0x68b/0x7b0 mm/readahead.c:270
 do_sync_mmap_readahead+0x7ae/0x980 mm/filemap.c:3107
 filemap_fault+0x813/0x17e0 mm/filemap.c:3199
 __do_fault+0x136/0x4f0 mm/memory.c:4261
 do_read_fault mm/memory.c:4612 [inline]
 do_fault mm/memory.c:4741 [inline]
 handle_pte_fault mm/memory.c:5013 [inline]
 __handle_mm_fault mm/memory.c:5155 [inline]
 handle_mm_fault+0x3412/0x5340 mm/memory.c:5276
 faultin_page mm/gup.c:1009 [inline]
 __get_user_pages+0x4f3/0x1190 mm/gup.c:1233
 populate_vma_page_range+0x217/0x2b0 mm/gup.c:1590
 __mm_populate+0x275/0x440 mm/gup.c:1704
 mm_populate include/linux/mm.h:2797 [inline]
 vm_mmap_pgoff+0x22b/0x2d0 mm/util.c:525
 ksys_mmap_pgoff+0x4f5/0x6d0 mm/mmap.c:1471
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f15d9e7dd69
RSP: 002b:00007f15dabf90c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007f15d9fabf80 RCX: 00007f15d9e7dd69
RDX: 00000000027fffff RSI: 0000000000600000 RDI: 0000000020000000
RBP: 00007f15d9eca49e R08: 0000000000000005 R09: 0000000000000000
R10: 0000000004002011 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f15d9fabf80 R15: 00007ffe22923b18
 </TASK>
INFO: task syz-executor.1:8253 blocked for more than 144 seconds.
      Not tainted 6.1.90-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.1  state:D stack:23488 pid:8253  ppid:7310   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5245 [inline]
 __schedule+0x142d/0x4550 kernel/sched/core.c:6558
 schedule+0xbf/0x180 kernel/sched/core.c:6634
 io_schedule+0x88/0x100 kernel/sched/core.c:8786
 folio_wait_bit_common+0x878/0x1290 mm/filemap.c:1296
 btrfs_page_mkwrite+0x429/0xc90 fs/btrfs/inode.c:8592
 do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:2992
 wp_page_shared+0x164/0x380 mm/memory.c:3341
 handle_pte_fault mm/memory.c:5031 [inline]
 __handle_mm_fault mm/memory.c:5155 [inline]
 handle_mm_fault+0x2525/0x5340 mm/memory.c:5276
 do_user_addr_fault arch/x86/mm/fault.c:1371 [inline]
 handle_page_fault arch/x86/mm/fault.c:1462 [inline]
 exc_page_fault+0x26f/0x660 arch/x86/mm/fault.c:1518
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0010:copy_user_short_string+0xd/0x40 arch/x86/lib/copy_user_64.S:233
Code: 74 0a 89 d1 f3 a4 89 c8 0f 01 ca c3 89 d0 0f 01 ca c3 01 ca eb e7 0f 1f 80 00 00 00 00 89 d1 83 e2 07 c1 e9 03 74 12 4c 8b 06 <4c> 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 89 d1 8a
RSP: 0018:ffffc9000711f3b0 EFLAGS: 00050202
RAX: ffffffff84382201 RBX: 00007fffffffefc8 RCX: 0000000000000007
RDX: 0000000000000000 RSI: ffffc9000711f460 RDI: 0000000020000360
RBP: ffffc9000711f510 R08: 0000000000000000 R09: fffff52000e23e93
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000038
R13: ffffc9000711f460 R14: 0000000020000360 R15: ffffc9000711f460
 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
 raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline]
 _copy_to_user+0xe9/0x130 lib/usercopy.c:41
 copy_to_user include/linux/uaccess.h:169 [inline]
 fiemap_fill_next_extent+0x231/0x410 fs/ioctl.c:144
 emit_fiemap_extent fs/btrfs/extent_io.c:3566 [inline]
 fiemap_process_hole+0x107e/0x1290 fs/btrfs/extent_io.c:3826
 extent_fiemap+0xef7/0x1ff0
 btrfs_fiemap+0x174/0x1e0 fs/btrfs/inode.c:8274
 ioctl_fiemap fs/ioctl.c:219 [inline]
 do_vfs_ioctl+0x18e9/0x2a90 fs/ioctl.c:810
 __do_sys_ioctl fs/ioctl.c:868 [inline]
 __se_sys_ioctl+0x81/0x160 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f15d9e7dd69
RSP: 002b:00007f15dabd80c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f15d9fac050 RCX: 00007f15d9e7dd69
RDX: 0000000020000340 RSI: 00000000c020660b RDI: 0000000000000004
RBP: 00007f15d9eca49e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f15d9fac050 R15: 00007ffe22923b18
 </TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
 #0: ffffffff8d12ae50 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xe30 kernel/rcu/tasks.h:516
1 lock held by rcu_tasks_trace/13:
 #0: ffffffff8d12b650 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xe30 kernel/rcu/tasks.h:516
3 locks held by kworker/1:0/22:
 #0: ffff888012470938 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc900001c7d20 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xa/0x50 net/core/link_watch.c:263
1 lock held by khungtaskd/28:
 #0: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #0: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #0: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x51/0x290 kernel/locking/lockdep.c:6494
3 locks held by kworker/u4:4/56:
 #0: ffff8881422bc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc90001577d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffff888062e4c0e0 (&type->s_umount_key#58){++++}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
2 locks held by getty/3306:
 #0: ffff88823bcb4898 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:244
 #1: ffffc900031262f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6a7/0x1db0 drivers/tty/n_tty.c:2188
2 locks held by kworker/1:3/3615:
 #0: ffff888012472138 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc9000506fd20 ((work_completion)(&rew->rew_work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
5 locks held by kworker/u4:7/3708:
 #0: ffff888012616938 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc90005cf7d20 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e28e690 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0xf1/0xb60 net/core/net_namespace.c:563
 #3: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: default_device_exit_batch+0xe5/0x9d0 net/core/dev.c:11380
 #4: ffffffff8d130278 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:323 [inline]
 #4: ffffffff8d130278 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x360/0x930 kernel/rcu/tree_exp.h:962
3 locks held by kworker/1:11/4596:
 #0: ffff888012470938 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc900113bfd20 (deferred_process_work){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: switchdev_deferred_process_work+0xa/0x20 net/switchdev/switchdev.c:104
1 lock held by syz-executor.1/8198:
 #0: ffff8880543a9ac0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline]
 #0: ffff8880543a9ac0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0xed/0x7b0 mm/readahead.c:226
4 locks held by syz-executor.1/8253:
 #0: ffff8880543a9920 (&sb->s_type->i_mutex_key#25){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:768 [inline]
 #0: ffff8880543a9920 (&sb->s_type->i_mutex_key#25){++++}-{3:3}, at: btrfs_inode_lock+0x5c/0xd0 fs/btrfs/inode.c:147
 #1: ffff8880207144d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #1: ffff8880207144d8 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline]
 #1: ffff8880207144d8 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5366
 #2: ffff888062e4c558 (sb_pagefaults#5){.+.+}-{0:0}, at: do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:2992
 #3: ffff8880543a97a8 (&ei->i_mmap_lock){++++}-{3:3}, at: btrfs_page_mkwrite+0x421/0xc90 fs/btrfs/inode.c:8591
2 locks held by syz-executor.2/11421:
 #0: ffff888062e4c0e0 (&type->s_umount_key#58){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:744
 #1: ffff888062e4e7d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff888062e4e7d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x270/0xb10 fs/fs-writeback.c:2737
1 lock held by syz-executor.2/11528:
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:74 [inline]
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x7c1/0xff0 net/core/rtnetlink.c:6118
1 lock held by syz-executor.0/11536:
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:74 [inline]
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x7c1/0xff0 net/core/rtnetlink.c:6118
2 locks held by syz-executor.4/11579:
 #0: ffffffff8ddbd6c8 (input_mutex){+.+.}-{3:3}, at: __input_unregister_device+0x308/0x630 drivers/input/input.c:2219
 #1: ffffffff8d130278 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:323 [inline]
 #1: ffffffff8d130278 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x360/0x930 kernel/rcu/tree_exp.h:962
1 lock held by syz-executor.3/11614:
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: dev_ioctl+0x59c/0xf70 net/core/dev_ioctl.c:612
1 lock held by syz-executor.1/11623:
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: __tun_chr_ioctl+0x465/0x2430 drivers/net/tun.c:3101
1 lock held by syz-executor.1/11624:
 #0: ffffffff8e29a9e8 (rtnl_mutex){+.+.}-{3:3}, at: devinet_ioctl+0x2a5/0x1b20 net/ipv4/devinet.c:1070

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

NMI backtrace for cpu 0
CPU: 0 PID: 28 Comm: khungtaskd Not tainted 6.1.90-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 nmi_cpu_backtrace+0x4e1/0x560 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x1b0/0x3f0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
 watchdog+0xf88/0xfd0 kernel/hung_task.c:377
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1 skipped: idling at native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
NMI backtrace for cpu 1 skipped: idling at arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
NMI backtrace for cpu 1 skipped: idling at acpi_safe_halt drivers/acpi/processor_idle.c:112 [inline]
NMI backtrace for cpu 1 skipped: idling at acpi_idle_do_entry+0x10f/0x340 drivers/acpi/processor_idle.c:572

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/08 07:02 linux-6.1.y 909ba1f1b414 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan INFO: task hung in extent_writepages
* Struck through repros no longer work on HEAD.