syzbot


INFO: task hung in btrfs_page_mkwrite (2)

Status: upstream: reported on 2024/05/15 18:57
Reported-by: syzbot+568ce2aeddf99237f29a@syzkaller.appspotmail.com
First crash: 150d, last: 98d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 INFO: task hung in btrfs_page_mkwrite 8 69d 150d 0/3 upstream: reported on 2024/05/15 17:15
upstream INFO: task hung in btrfs_page_mkwrite btrfs 49 236d 374d 0/28 auto-obsoleted due to no activity on 2024/05/29 11:09
linux-5.15 INFO: task hung in btrfs_page_mkwrite 1 482d 482d 0/3 auto-obsoleted due to no activity on 2023/09/26 02:15

Sample crash report:
INFO: task syz.4.2797:18287 blocked for more than 143 seconds.
      Not tainted 5.15.162-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.4.2797      state:D stack:25656 pid:18287 ppid: 17343 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 io_schedule+0x88/0x100 kernel/sched/core.c:8484
 wait_on_page_bit_common+0xa13/0x1180 mm/filemap.c:1356
 lock_page include/linux/pagemap.h:625 [inline]
 btrfs_page_mkwrite+0x537/0xd60 fs/btrfs/inode.c:8943
 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
 wp_page_shared+0x179/0x690 mm/memory.c:3229
 handle_pte_fault mm/memory.c:4639 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854
 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline]
 handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0033:0x7efc93d936eb
RSP: 002b:00007ffe2938d5f8 EFLAGS: 00010202
RAX: 0000000020000040 RBX: 0000000000000004 RCX: 0000000000737562
RDX: 0000000000000006 RSI: 0000000075622f2e RDI: 0000000020000040
RBP: fffffffffffffffe R08: 00007efc93c56000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000009 R12: 00007efc93f59f6c
R13: 0000000000000032 R14: 00007efc93f5ba60 R15: 00007ffe2938d6e0
 </TASK>
INFO: task syz.4.2797:18288 blocked for more than 144 seconds.
      Not tainted 5.15.162-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.4.2797      state:D stack:23264 pid:18288 ppid: 17343 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 wait_on_state fs/btrfs/extent_io.c:868 [inline]
 wait_extent_bit+0x3f9/0x530 fs/btrfs/extent_io.c:906
 lock_extent_bits+0x10d/0x1e0 fs/btrfs/extent_io.c:1469
 btrfs_page_mkwrite+0x5f2/0xd60 fs/btrfs/inode.c:8953
 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
 wp_page_shared+0x179/0x690 mm/memory.c:3229
 handle_pte_fault mm/memory.c:4639 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854
 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline]
 handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0010:copy_user_generic_unrolled+0x89/0xc0 arch/x86/lib/copy_user_64.S:92
Code: 38 4c 89 47 20 4c 89 4f 28 4c 89 57 30 4c 89 5f 38 48 8d 76 40 48 8d 7f 40 ff c9 75 b6 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:ffffc900012ff668 EFLAGS: 00050202
RAX: ffffffff8408f601 RBX: 0000000020000218 RCX: 0000000000000007
RDX: 0000000000000000 RSI: ffffc900012ff720 RDI: 00000000200001e0
RBP: ffffc900012ff7d0 R08: 0000000000000000 R09: fffff5200025feeb
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000038
R13: 00007ffffffff000 R14: ffffc900012ff720 R15: 00000000200001e0
 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+0xef/0x130 lib/usercopy.c:40
 copy_to_user include/linux/uaccess.h:200 [inline]
 fiemap_fill_next_extent+0x231/0x410 fs/ioctl.c:144
 emit_fiemap_extent fs/btrfs/extent_io.c:5448 [inline]
 extent_fiemap+0x1185/0x1650 fs/btrfs/extent_io.c:5687
 btrfs_fiemap+0x121/0x160 fs/btrfs/inode.c:8576
 ioctl_fiemap fs/ioctl.c:219 [inline]
 do_vfs_ioctl+0x1934/0x2b70 fs/ioctl.c:814
 __do_sys_ioctl fs/ioctl.c:872 [inline]
 __se_sys_ioctl+0x81/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7efc93dcbbd9
RSP: 002b:00007efc9284c048 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007efc93f59f60 RCX: 00007efc93dcbbd9
RDX: 00000000200001c0 RSI: 00000000c020660b RDI: 0000000000000004
RBP: 00007efc93e3aaa1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007efc93f59f60 R15: 00007ffe2938d518
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/27:
 #0: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3266:
 #0: ffff88814afd1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
 #1: ffffc9000209b2e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6af/0x1db0 drivers/tty/n_tty.c:2158
2 locks held by kworker/0:3/3494:
 #0: ffff888011c72138 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc900024d7d20 ((work_completion)(&rew.rew_work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
2 locks held by kworker/u4:6/3607:
3 locks held by syz.4.2797/18287:
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline]
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501
 #1: ffff888059928558 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
 #2: ffff888062dd5318 (&ei->i_mmap_lock){++++}-{3:3}, at: btrfs_page_mkwrite+0x4a2/0xd60 fs/btrfs/inode.c:8942
3 locks held by syz.4.2797/18288:
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline]
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 #0: ffff88807e35b928 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501
 #1: ffff888059928558 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
 #2: ffff888062dd5318 (&ei->i_mmap_lock){++++}-{3:3}, at: btrfs_page_mkwrite+0x4a2/0xd60 fs/btrfs/inode.c:8942
6 locks held by syz.2.2874/18635:
4 locks held by syz.0.2915/18816:
4 locks held by syz.3.2956/18963:
3 locks held by syz.2.3372/20343:
 #0: ffff88805c193e10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
 #0: ffff88805c193e10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: __sock_release net/socket.c:648 [inline]
 #0: ffff88805c193e10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: sock_close+0x98/0x230 net/socket.c:1336
 #1: ffff88805153d120 (sk_lock-AF_CAN){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1676 [inline]
 #1: ffff88805153d120 (sk_lock-AF_CAN){+.+.}-{0:0}, at: bcm_release+0x1e0/0x860 net/can/bcm.c:1522
 #2: ffffffff8c9240e8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:290 [inline]
 #2: ffffffff8c9240e8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x280/0x740 kernel/rcu/tree_exp.h:845

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

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Not tainted 5.15.162-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 nmi_cpu_backtrace+0x46a/0x4a0 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x181/0x2a0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:210 [inline]
 watchdog+0xe72/0xeb0 kernel/hung_task.c:295
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
 </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:109 [inline]
NMI backtrace for cpu 1 skipped: idling at acpi_idle_do_entry+0x10f/0x340 drivers/acpi/processor_idle.c:570

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/06 01:08 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in btrfs_page_mkwrite
2024/05/26 21:41 linux-5.15.y c61bd26ae81a a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in btrfs_page_mkwrite
2024/05/15 19:00 linux-5.15.y 284087d4f7d5 94b087b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in btrfs_page_mkwrite
2024/05/15 18:57 linux-5.15.y 284087d4f7d5 94b087b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 INFO: task hung in btrfs_page_mkwrite
* Struck through repros no longer work on HEAD.