Kernel bug: INFO: task hung in blkdev_write_iter
Subsystem: block
Status: open

Crash report:
INFO: task syz.0.17:6033 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.0.17        state:D stack:23944 pid:6033  tgid:6032  ppid:5951   task_flags:0x400040 flags:0x00080002
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5295 [inline]
 __schedule+0x1585/0x5340 kernel/sched/core.c:6907
 __schedule_loop kernel/sched/core.c:6989 [inline]
 schedule+0x164/0x360 kernel/sched/core.c:7004
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:7061
 rwsem_down_read_slowpath+0x61e/0x920 kernel/locking/rwsem.c:1086
 __down_read_common kernel/locking/rwsem.c:1261 [inline]
 __down_read kernel/locking/rwsem.c:1274 [inline]
 down_read+0x99/0x2e0 kernel/locking/rwsem.c:1539
 inode_lock_shared include/linux/fs.h:1043 [inline]
 blkdev_write_iter+0x50b/0x710 block/fops.c:801
 iter_file_splice_write+0x99b/0x1100 fs/splice.c:738
 do_splice_from fs/splice.c:938 [inline]
 direct_splice_actor+0x101/0x160 fs/splice.c:1161
 splice_direct_to_actor+0x53a/0xc70 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0x195/0x290 fs/splice.c:1230
 do_sendfile+0x535/0x7d0 fs/read_write.c:1372
 __do_sys_sendfile64 fs/read_write.c:1433 [inline]
 __se_sys_sendfile64+0x144/0x1a0 fs/read_write.c:1419
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0b3a59c629
RSP: 002b:00007f0b3b4e0028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f0b3a815fa0 RCX: 00007f0b3a59c629
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000003
RBP: 00007f0b3a632b39 R08: 0000000000000000 R09: 0000000000000000
R10: 000400000000003f R11: 0000000000000246 R12: 0000000000000000
R13: 00007f0b3a816038 R14: 00007f0b3a815fa0 R15: 00007ffe34502d38
 </TASK>

Showing all locks held in the system:
1 lock held by ksoftirqd/1/23:
 #0: ffff8880b873ade0 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x31/0x150 kernel/sched/core.c:647
1 lock held by khungtaskd/31:
 #0: ffffffff8e7602e0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:312 [inline]
 #0: ffffffff8e7602e0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:850 [inline]
 #0: ffffffff8e7602e0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180 kernel/locking/lockdep.c:6775
2 locks held by getty/5585:
 #0: ffff8880370010a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc9000331e2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x45c/0x13c0 drivers/tty/n_tty.c:2211
1 lock held by syz.0.17/6033:
 #0: ffff88802384aa28 (&sb->s_type->i_mutex_key#11){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:1043 [inline]
 #0: ffff88802384aa28 (&sb->s_type->i_mutex_key#11){++++}-{4:4}, at: blkdev_write_iter+0x50b/0x710 block/fops.c:801
3 locks held by syz.0.17/6036:
4 locks held by syz-executor/13728:

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

NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 31 Comm: khungtaskd Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x274/0x2d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x17a/0x300 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:161 [inline]
 __sys_info lib/sys_info.c:157 [inline]
 sys_info+0x135/0x170 lib/sys_info.c:165
 check_hung_uninterruptible_tasks kernel/hung_task.c:346 [inline]
 watchdog+0xfd9/0x1030 kernel/hung_task.c:515
 kthread+0x388/0x470 kernel/kthread.c:467
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 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: 1331 Comm: kworker/u8:9 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Workqueue: events_unbound toggle_allocation_gate
RIP: 0010:switch_mm_irqs_off+0x354/0x690 arch/x86/include/asm/bitops.h:-1
Code: 93 4c 39 e0 0f 85 9d 00 00 00 e9 8f 01 00 00 83 fd 08 0f 83 0d 02 00 00 4c 89 f7 be 08 00 00 00 e8 21 3d b7 00 f0 4d 0f ab 27 <48> 8b 6c 24 10 4c 8d b3 b8 08 00 00 4c 89 f7 be 08 00 00 00 e8 d3
RSP: 0018:ffffc90005d6f710 EFLAGS: 00000056
RAX: 0000000000000001 RBX: ffff88813fe38c40 RCX: ffffffff8178590f
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff88813fe397c0
RBP: 0000000000000001 R08: ffff88813fe397c7 R09: 1ffff11027fc72f8
R10: dffffc0000000000 R11: ffffed1027fc72f9 R12: 0000000000000001
R13: dffffc0000000000 R14: ffff88813fe397c0 R15: ffff88813fe397c0
FS:  0000000000000000(0000) GS:ffff888125566000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe3561456b8 CR3: 000000000e54c000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 use_temporary_mm+0x98/0x140 arch/x86/mm/tlb.c:1029
 __text_poke+0x632/0x9a0 arch/x86/kernel/alternative.c:2581
 text_poke arch/x86/kernel/alternative.c:2645 [inline]
 smp_text_poke_batch_finish+0xd36/0x1160 arch/x86/kernel/alternative.c:3034
 arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146
 static_key_enable_cpuslocked+0x128/0x240 kernel/jump_label.c:210
 static_key_enable+0x1a/0x20 kernel/jump_label.c:223
 toggle_allocation_gate+0xab/0x290 mm/kfence/core.c:899
 process_one_work kernel/workqueue.c:3275 [inline]
 process_scheduled_works+0xb02/0x1830 kernel/workqueue.c:3358
 worker_thread+0xa50/0xfc0 kernel/workqueue.c:3439
 kthread+0x388/0x470 kernel/kthread.c:467
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>