syzbot


INFO: task hung in page_cache_ra_unbounded (2)

Status: upstream: reported on 2024/09/01 11:14
Reported-by: syzbot+5161afd1a37107ca313d@syzkaller.appspotmail.com
First crash: 63d, last: 44d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in page_cache_ra_unbounded fs mm 2 1053d 1073d 0/28 closed as invalid on 2022/02/08 09:40
upstream INFO: task hung in page_cache_ra_unbounded (2) fs mm C done 3600 1d09h 62d 0/28 upstream: reported C repro on 2024/09/02 00:15
linux-6.1 INFO: task hung in page_cache_ra_unbounded 2 39d 40d 0/3 upstream: reported on 2024/09/24 05:33
linux-5.15 INFO: task hung in page_cache_ra_unbounded 3 220d 282d 0/3 auto-obsoleted due to no activity on 2024/07/06 02:06

Sample crash report:
INFO: task syz.3.285:4814 blocked for more than 143 seconds.
      Not tainted 5.15.165-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.285       state:D stack:27312 pid: 4814 ppid:  3569 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5027 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6373
 schedule+0x11b/0x1f0 kernel/sched/core.c:6456
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6515
 rwsem_down_read_slowpath+0x605/0xb40 kernel/locking/rwsem.c:1055
 __down_read_common kernel/locking/rwsem.c:1239 [inline]
 __down_read kernel/locking/rwsem.c:1252 [inline]
 down_read+0x9a/0x2e0 kernel/locking/rwsem.c:1500
 filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195
 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996
 filemap_fault+0x77a/0x1470 mm/filemap.c:3089
 __do_fault+0x139/0x340 mm/memory.c:3898
 do_read_fault mm/memory.c:4234 [inline]
 do_fault mm/memory.c:4362 [inline]
 handle_pte_fault mm/memory.c:4621 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x376f/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:do_strncpy_from_user lib/strncpy_from_user.c:41 [inline]
RIP: 0010:strncpy_from_user+0x170/0x370 lib/strncpy_from_user.c:139
Code: 4c 89 ee e8 d2 06 56 fd 49 83 fd 07 0f 86 a2 00 00 00 4c 89 7c 24 08 48 c7 44 24 10 f8 ff ff ff 45 31 e4 4c 89 f5 48 8b 04 24 <4e> 8b 3c 20 48 b8 ff fe fe fe fe fe fe fe 49 8d 1c 07 4d 89 fe 49
RSP: 0018:ffffc90003227e60 EFLAGS: 00050246
RAX: 0000000020000240 RBX: 00007ffffffff000 RCX: ffff888075255940
RDX: ffffc900041e0000 RSI: 0000000000000fe0 RDI: 0000000000000007
RBP: ffff888061f00020 R08: ffffffff842a5eae R09: 0000000000001000
R10: ffff8880171f2500 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000fe0 R14: ffff888061f00020 R15: 0000000000000fe0
 getname_flags+0xf5/0x4e0 fs/namei.c:149
 getname fs/namei.c:217 [inline]
 __do_sys_mknod fs/namei.c:4027 [inline]
 __se_sys_mknod fs/namei.c:4025 [inline]
 __x64_sys_mknod+0x77/0xa0 fs/namei.c:4025
 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:0x7f06620ddeb9
RSP: 002b:00007f066055a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000085
RAX: ffffffffffffffda RBX: 00007f0662279f80 RCX: 00007f06620ddeb9
RDX: 00000000fffffffd RSI: 0000000000000800 RDI: 0000000020000240
RBP: 00007f066214b93e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f0662279f80 R15: 00007ffdb336ec08
 </TASK>
INFO: task syz.3.285:4819 blocked for more than 144 seconds.
      Not tainted 5.15.165-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.285       state:D stack:27448 pid: 4819 ppid:  3569 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5027 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6373
 schedule+0x11b/0x1f0 kernel/sched/core.c:6456
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6515
 rwsem_down_read_slowpath+0x605/0xb40 kernel/locking/rwsem.c:1055
 __down_read_common kernel/locking/rwsem.c:1239 [inline]
 __down_read kernel/locking/rwsem.c:1252 [inline]
 down_read+0x9a/0x2e0 kernel/locking/rwsem.c:1500
 filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195
 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996
 filemap_fault+0x77a/0x1470 mm/filemap.c:3089
 __do_fault+0x139/0x340 mm/memory.c:3898
 do_read_fault mm/memory.c:4234 [inline]
 do_fault mm/memory.c:4362 [inline]
 handle_pte_fault mm/memory.c:4621 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x376f/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_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:206
Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 0f 01 cb 83 fa 40 0f 82 70 ff ff ff 89 d1 <f3> a4 31 c0 0f 01 ca c3 66 2e 0f 1f 84 00 00 00 00 00 89 d1 83 f8
RSP: 0018:ffffc90003317d88 EFLAGS: 00050202
RAX: ffffffff84092801 RBX: 0000000020000108 RCX: 0000000000000048
RDX: 0000000000000048 RSI: 00000000200000c0 RDI: ffffc90003317e00
RBP: ffffc90003317ef8 R08: dffffc0000000000 R09: fffff52000662fc9
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000048
R13: 00007ffffffff000 R14: ffffc90003317e00 R15: 00000000200000c0
 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
 raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline]
 _copy_from_user+0xf9/0x170 lib/usercopy.c:23
 copy_from_user include/linux/uaccess.h:192 [inline]
 copy_from_bpfptr_offset include/linux/bpfptr.h:52 [inline]
 copy_from_bpfptr include/linux/bpfptr.h:58 [inline]
 __sys_bpf+0x1d5/0x670 kernel/bpf/syscall.c:4624
 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4753 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753
 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:0x7f06620ddeb9
RSP: 002b:00007f0660539038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f066227a058 RCX: 00007f06620ddeb9
RDX: 0000000000000048 RSI: 00000000200000c0 RDI: 0000000000000000
RBP: 00007f066214b93e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f066227a058 R15: 00007ffdb336ec08
 </TASK>
INFO: task syz.3.285:4825 blocked for more than 145 seconds.
      Not tainted 5.15.165-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.285       state:D stack:26560 pid: 4825 ppid:  3569 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5027 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6373
 schedule+0x11b/0x1f0 kernel/sched/core.c:6456
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6515
 rwsem_down_read_slowpath+0x605/0xb40 kernel/locking/rwsem.c:1055
 __down_read_common kernel/locking/rwsem.c:1239 [inline]
 __down_read kernel/locking/rwsem.c:1252 [inline]
 down_read+0x9a/0x2e0 kernel/locking/rwsem.c:1500
 filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195
 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996
 filemap_fault+0x77a/0x1470 mm/filemap.c:3089
 __do_fault+0x139/0x340 mm/memory.c:3898
 do_read_fault mm/memory.c:4234 [inline]
 do_fault mm/memory.c:4362 [inline]
 handle_pte_fault mm/memory.c:4621 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x376f/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:do_strncpy_from_user lib/strncpy_from_user.c:41 [inline]
RIP: 0010:strncpy_from_user+0x170/0x370 lib/strncpy_from_user.c:139
Code: 4c 89 ee e8 d2 06 56 fd 49 83 fd 07 0f 86 a2 00 00 00 4c 89 7c 24 08 48 c7 44 24 10 f8 ff ff ff 45 31 e4 4c 89 f5 48 8b 04 24 <4e> 8b 3c 20 48 b8 ff fe fe fe fe fe fe fe 49 8d 1c 07 4d 89 fe 49
RSP: 0018:ffffc90003267df0 EFLAGS: 00050246
RAX: 0000000020000000 RBX: 00007ffffffff000 RCX: ffff88801e043b80
RDX: ffffc900064c1000 RSI: 0000000000000020 RDI: 0000000000000007
RBP: ffffc90003267e80 R08: ffffffff842a5eae R09: ffffffff81d35613
R10: 0000000000000003 R11: ffff88801e043b80 R12: 0000000000000000
R13: 0000000000000020 R14: ffffc90003267e80 R15: 0000000000000020
 key_get_type_from_user security/keys/keyctl.c:51 [inline]
 __do_sys_add_key security/keys/keyctl.c:90 [inline]
 __se_sys_add_key+0xd5/0x480 security/keys/keyctl.c:74
 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:0x7f06620ddeb9
RSP: 002b:00007f0660518038 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8
RAX: ffffffffffffffda RBX: 00007f066227a130 RCX: 00007f06620ddeb9
RDX: 0000000020000080 RSI: 0000000020000040 RDI: 0000000020000000
RBP: 00007f066214b93e R08: ffffffffffffffff R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f066227a130 R15: 00007ffdb336ec08
 </TASK>

Showing all locks held in the system:
4 locks held by kworker/u4:0/9:
 #0: ffff8880171d5938 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc90000ce7d20 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffffffff8da25210 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0xf1/0xb60 net/core/net_namespace.c:561
 #3: ffffffff8c9241a8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:290 [inline]
 #3: ffffffff8c9241a8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x280/0x740 kernel/rcu/tree_exp.h:845
3 locks held by kworker/0:1/13:
 #0: ffff888017070938 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc90000d27d20 ((work_completion)(&pwq->unbound_release_work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffffffff8c9241a8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:322 [inline]
 #2: ffffffff8c9241a8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x350/0x740 kernel/rcu/tree_exp.h:845
1 lock held by khungtaskd/27:
 #0: ffffffff8c91fbe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3321:
 #0: ffff88802a16c098 (&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 syz.0.80/4006:
2 locks held by kworker/0:20/4310:
 #0: ffff888017072138 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc90003347d20 ((work_completion)(&rew.rew_work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
3 locks held by kworker/1:16/4394:
 #0: ffff888017070938 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc900036b7d20 (fqdir_free_work){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffffffff8c9240b0 (rcu_state.barrier_mutex){+.+.}-{3:3}, at: rcu_barrier+0x9c/0x4e0 kernel/rcu/tree.c:4039
1 lock held by syz.3.285/4814:
 #0: ffff88814085e778 (mapping.invalidate_lock#2){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 #0: ffff88814085e778 (mapping.invalidate_lock#2){++++}-{3:3}, at: page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195
1 lock held by syz.3.285/4819:
 #0: ffff88814085e778 (mapping.invalidate_lock#2){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 #0: ffff88814085e778 (mapping.invalidate_lock#2){++++}-{3:3}, at: page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195
1 lock held by syz.3.285/4825:
 #0: ffff88814085e778 (mapping.invalidate_lock#2){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 #0: ffff88814085e778 (mapping.invalidate_lock#2){++++}-{3:3}, at: page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195

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

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Not tainted 5.15.165-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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:287
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 9 Comm: kworker/u4:0 Not tainted 5.15.165-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Workqueue: netns cleanup_net
RIP: 0010:kasan_mem_to_shadow include/linux/kasan.h:55 [inline]
RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:128 [inline]
RIP: 0010:memory_is_poisoned mm/kasan/generic.c:159 [inline]
RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline]
RIP: 0010:kasan_check_range+0x33/0x290 mm/kasan/generic.c:189
Code: 85 f6 0f 84 9a 01 00 00 48 89 fd 48 01 f5 0f 82 59 02 00 00 48 89 fd 48 c1 ed 2f 81 fd ff ff 01 00 0f 82 46 02 00 00 48 89 fb <48> c1 eb 03 49 b8 00 00 00 00 00 fc ff df 4e 8d 0c 03 4c 8d 54 37
RSP: 0018:ffffc90000ce7898 EFLAGS: 00000246
RAX: 0000000000000001 RBX: ffffffff8de952a8 RCX: ffffffff8162adbc
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8de952a8
RBP: 000000000001ffff R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff9200019cf20
R13: dffffc0000000000 R14: 0000000000000000 R15: ffffc9000195dfd0
FS:  0000000000000000(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd5b4d9d38 CR3: 0000000074648000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 instrument_atomic_read include/linux/instrumented.h:71 [inline]
 test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
 cpumask_test_cpu include/linux/cpumask.h:344 [inline]
 cpu_online include/linux/cpumask.h:895 [inline]
 trace_lock_acquire include/trace/events/lock.h:13 [inline]
 lock_acquire+0xcc/0x4f0 kernel/locking/lockdep.c:5594
 rcu_lock_acquire+0x2a/0x30 include/linux/rcupdate.h:312
 rcu_read_lock include/linux/rcupdate.h:739 [inline]
 inet_twsk_purge+0x129/0x9d0 net/ipv4/inet_timewait_sock.c:268
 tcp_sk_exit_batch+0x28/0x90 net/ipv4/tcp_ipv4.c:3231
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x763/0xb60 net/core/net_namespace.c:599
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/01 11:13 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in page_cache_ra_unbounded
2024/09/20 12:01 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 INFO: task hung in page_cache_ra_unbounded
* Struck through repros no longer work on HEAD.