Kernel bug: INFO: task hung in fdget_pos
Subsystem: fs, kernfs
Status: open

Crash report:
INFO: task syz-executor221:5846 blocked for more than 143 seconds.
      Not tainted 6.16.0-rc6-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor221 state:D stack:29728 pid:5846  tgid:5841  ppid:5840   task_flags:0x400040 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5397 [inline]
 __schedule+0x16a2/0x4cb0 kernel/sched/core.c:6786
 __schedule_loop kernel/sched/core.c:6864 [inline]
 schedule+0x165/0x360 kernel/sched/core.c:6879
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6936
 __mutex_lock_common kernel/locking/mutex.c:679 [inline]
 __mutex_lock+0x724/0xe80 kernel/locking/mutex.c:747
 fdget_pos+0x247/0x320 fs/file.c:1217
 class_fd_pos_constructor include/linux/file.h:85 [inline]
 ksys_read+0x79/0x250 fs/read_write.c:706
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f38818a7589
RSP: 002b:00007f388183b218 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f388192f618 RCX: 00007f38818a7589
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f388192f610 R08: 00007ffeb1c29c07 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f38818fbb1c
R13: 0000200000000180 R14: 0000200000002200 R15: 00002000000002c0
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/31:
 #0: ffffffff8e13f0e0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #0: ffffffff8e13f0e0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #0: ffffffff8e13f0e0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180 kernel/locking/lockdep.c:6770
2 locks held by kworker/u8:2/36:
 #0: ffff8880b8639e18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:606
 #1: ffff8880b8623f08 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x39e/0x6d0 kernel/sched/psi.c:987
2 locks held by getty/5596:
 #0: ffff888030e250a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc9000333b2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x43e/0x1400 drivers/tty/n_tty.c:2222
4 locks held by syz-executor221/5844:
1 lock held by syz-executor221/5846:
 #0: ffff888029352478 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x247/0x320 fs/file.c:1217

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

NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 31 Comm: khungtaskd Not tainted 6.16.0-rc6-syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x39e/0x3d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x17a/0x300 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:158 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:307 [inline]
 watchdog+0xfee/0x1030 kernel/hung_task.c:470
 kthread+0x711/0x8a0 kernel/kthread.c:464
 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 5844 Comm: syz-executor221 Not tainted 6.16.0-rc6-syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:lockdep_recursion_finish kernel/locking/lockdep.c:473 [inline]
RIP: 0010:lockdep_hardirqs_on_prepare+0x1a8/0x2a0 kernel/locking/lockdep.c:4414
Code: ba 07 00 00 00 83 da 00 48 89 df 4c 89 f6 e8 bf 45 00 00 85 c0 75 bd eb 11 48 c7 c7 10 00 01 8e 4c 89 fe e8 ea 08 52 03 eb c3 <48> c7 c7 0a 21 b7 8d e8 bc 2e ca 09 b8 ff ff ff ff 65 0f c1 05 9f
RSP: 0018:ffffc900040ff838 EFLAGS: 00000046
RAX: 0000000000000002 RBX: ffff888032efda00 RCX: ffffffff934a1918
RDX: 0000000000000006 RSI: ffff888032efe518 RDI: ffff888032efda00
RBP: dffffc0000000000 R08: ffffffff8fa0cbf7 R09: 1ffffffff1f4197e
R10: dffffc0000000000 R11: fffffbfff1f4197f R12: ffff888032efe540
R13: 0000200000001000 R14: ffff888032efe540 R15: 0000000000000002
FS:  00007f388185c6c0(0000) GS:ffff888125d4f000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000001000 CR3: 0000000076be0000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 trace_hardirqs_on+0x28/0x40 kernel/trace/trace_preemptirq.c:78
 do_user_addr_fault+0x1a8/0x1390 arch/x86/mm/fault.c:1281
 handle_page_fault arch/x86/mm/fault.c:1476 [inline]
 exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:rep_movs_alternative+0x4a/0x90 arch/x86/lib/copy_user_64.S:74
Code: cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 db 83 f9 08 73 e8 eb c5 <f3> a4 c3 cc cc cc cc 48 8b 06 48 89 07 48 8d 47 08 48 83 e0 f8 48
RSP: 0018:ffffc900040ffa18 EFLAGS: 00050202
RAX: ffffffff84b84b01 RBX: ffff888078730000 RCX: 000000000000000a
RDX: 0000000000000000 RSI: ffff888078730e80 RDI: 0000200000001000
RBP: ffffc900040ffb78 R08: ffff888078730e89 R09: 1ffff1100f0e61d1
R10: dffffc0000000000 R11: ffffed100f0e61d2 R12: 1ffff9200081ffaf
R13: 0000200000000180 R14: ffffc900040ffd88 R15: 0000000000000e8a
 copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline]
 raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline]
 copy_to_user_iter lib/iov_iter.c:25 [inline]
 iterate_ubuf include/linux/iov_iter.h:30 [inline]
 iterate_and_advance2 include/linux/iov_iter.h:300 [inline]
 iterate_and_advance include/linux/iov_iter.h:328 [inline]
 _copy_to_iter+0x24c/0x16f0 lib/iov_iter.c:185
 copy_to_iter include/linux/uio.h:220 [inline]
 seq_read_iter+0xbeb/0xe10 fs/seq_file.c:281
 proc_reg_read_iter+0x1b4/0x280 fs/proc/inode.c:299
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x4d0/0x980 fs/read_write.c:572
 ksys_read+0x145/0x250 fs/read_write.c:715
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f38818a7589
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 18 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:00007f388185c218 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f388192f608 RCX: 00007f38818a7589
RDX: 0000000000002024 RSI: 0000200000000180 RDI: 0000000000000005
RBP: 00007f388192f600 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f38818fbb1c
R13: 0000200000000180 R14: 0000200000002200 R15: 00002000000002c0
 </TASK>