syzbot


INFO: task hung in ext4_page_mkwrite

Status: upstream: reported on 2024/04/07 13:25
Reported-by: syzbot+5eca1585555a92d98f82@syzkaller.appspotmail.com
First crash: 69d, last: 69d

Sample crash report:
INFO: task syz-executor.0:14028 blocked for more than 143 seconds.
      Not tainted 6.1.84-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0  state:D stack:25000 pid:14028 ppid:3576   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
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6693
 rwsem_down_read_slowpath kernel/locking/rwsem.c:1094 [inline]
 __down_read_common kernel/locking/rwsem.c:1261 [inline]
 __down_read kernel/locking/rwsem.c:1274 [inline]
 down_read+0x6ff/0xa30 kernel/locking/rwsem.c:1522
 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline]
 ext4_page_mkwrite+0x1d7/0x10d0 fs/ext4/inode.c:6192
 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: 0033:0x7f5dd5c5ef18
RSP: 002b:00007fff990e2cc8 EFLAGS: 00010202
RAX: 0000000020000000 RBX: 00007fff990e2dd8 RCX: 00317073642f7665
RDX: 000000000000000a RSI: 7073642f7665642f RDI: 0000000020000000
RBP: 0000000000000032 R08: 00007f5dd5c00000 R09: 0000000000000010
R10: 00007fff99149080 R11: 0000000000015ec6 R12: 00007f5dd58024e8
R13: fffffffffffffffe R14: 00007f5dd5800000 R15: 00007f5dd58024f0
 </TASK>
INFO: task syz-executor.0:14033 blocked for more than 143 seconds.
      Not tainted 6.1.84-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0  state:D stack:25128 pid:14033 ppid:3576   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
 rwsem_down_write_slowpath+0xea1/0x14b0 kernel/locking/rwsem.c:1189
 filemap_invalidate_lock include/linux/fs.h:803 [inline]
 ext4_punch_hole+0x409/0xd00 fs/ext4/inode.c:4075
 ext4_fallocate+0x30b/0x2160 fs/ext4/extents.c:4737
 vfs_fallocate+0x547/0x6b0 fs/open.c:323
 madvise_remove mm/madvise.c:991 [inline]
 madvise_vma_behavior mm/madvise.c:1015 [inline]
 madvise_walk_vmas mm/madvise.c:1250 [inline]
 do_madvise+0x18b6/0x4470 mm/madvise.c:1429
 __do_sys_madvise mm/madvise.c:1442 [inline]
 __se_sys_madvise mm/madvise.c:1440 [inline]
 __x64_sys_madvise+0xa1/0xb0 mm/madvise.c:1440
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5dd5c7de69
RSP: 002b:00007f5dd6a4f0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 00007f5dd5dac050 RCX: 00007f5dd5c7de69
RDX: 0000000000000009 RSI: 0000000000600016 RDI: 0000000020000000
RBP: 00007f5dd5cca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f5dd5dac050 R15: 00007fff990e2be8
 </TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
 #0: ffffffff8d12ab50 (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: ffffffff8d12b350 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xe30 kernel/rcu/tasks.h:516
1 lock held by khungtaskd/28:
 #0: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #0: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #0: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x51/0x290 kernel/locking/lockdep.c:6494
2 locks held by getty/3306:
 #0: ffff8880133b0098 (&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
3 locks held by syz-fuzzer/3549:
 #0: ffff88814c4f8460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
 #1: ffff88804dc8d440 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline]
 #1: ffff88804dc8d440 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_unlinkat+0x266/0x820 fs/namei.c:4375
 #2: ffff88804dd2c030 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #2: ffff88804dd2c030 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: vfs_unlink+0xe0/0x5f0 fs/namei.c:4313
3 locks held by syz-executor.0/14028:
 #0: ffff8880153953d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #0: ffff8880153953d8 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline]
 #0: ffff8880153953d8 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5366
 #1: ffff88814c4f8558 (sb_pagefaults){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1891 [inline]
 #1: ffff88814c4f8558 (sb_pagefaults){.+.+}-{0:0}, at: sb_start_pagefault include/linux/fs.h:1995 [inline]
 #1: ffff88814c4f8558 (sb_pagefaults){.+.+}-{0:0}, at: ext4_page_mkwrite+0x1ad/0x10d0 fs/ext4/inode.c:6189
 #2: ffff88804dd2c1d0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline]
 #2: ffff88804dd2c1d0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_page_mkwrite+0x1d7/0x10d0 fs/ext4/inode.c:6192
2 locks held by syz-executor.0/14029:
3 locks held by syz-executor.0/14033:
 #0: ffff88814c4f8460 (sb_writers#4){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3010 [inline]
 #0: ffff88814c4f8460 (sb_writers#4){.+.+}-{0:0}, at: vfs_fallocate+0x4ba/0x6b0 fs/open.c:322
 #1: ffff88804dd2c030 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #1: ffff88804dd2c030 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_punch_hole+0x1f8/0xd00 fs/ext4/inode.c:4028
 #2: ffff88804dd2c1d0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:803 [inline]
 #2: ffff88804dd2c1d0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_punch_hole+0x409/0xd00 fs/ext4/inode.c:4075

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

NMI backtrace for cpu 1
CPU: 1 PID: 28 Comm: khungtaskd Not tainted 6.1.84-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:307
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 14029 Comm: syz-executor.0 Not tainted 6.1.84-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:__filemap_add_folio+0x3e5/0x1ba0 mm/filemap.c:863
Code: e8 b0 4a d3 ff bb 01 00 00 00 49 8d 7d 34 48 89 bc 24 a0 00 00 00 be 04 00 00 00 e8 c5 c2 2a 00 48 89 5c 24 78 f0 41 01 5d 34 <49> 8d 5d 18 48 89 d8 48 c1 e8 03 48 89 84 24 b0 00 00 00 42 80 3c
RSP: 0018:ffffc9000819f260 EFLAGS: 00000202
RAX: ffffffff81b74b01 RBX: 0000000000000001 RCX: ffffffff81b73c5b
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffea00010cbb34
RBP: ffffc9000819f3f0 R08: dffffc0000000000 R09: fffff94000219767
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffffea00010cbb00 R14: ffffc9000819f340 R15: 00fff80000000001
FS:  00007f5dd6a706c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1147d7b978 CR3: 00000000609fd000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 filemap_add_folio+0x11d/0x570 mm/filemap.c:934
 page_cache_ra_unbounded+0x20c/0x7b0 mm/readahead.c:251
 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+0x3d/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5dd5c7de69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5dd6a700c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007f5dd5dabf80 RCX: 00007f5dd5c7de69
RDX: 0000000000000002 RSI: 0000000000b36000 RDI: 0000000020000000
RBP: 00007f5dd5cca47a R08: 000000000000000a R09: 0000000000000000
R10: 0000000000028011 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f5dd5dabf80 R15: 00007fff990e2be8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/07 13:24 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan INFO: task hung in ext4_page_mkwrite
* Struck through repros no longer work on HEAD.