BUG: soft lockup in ext4_file_write_iter

Status: moderation: reported on 2026/11/24 05:51
Subsystems: ext4
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+052beac95c8ac9343797@syzkaller.appspotmail.com
First crash: 1h02m, last: 1h02m
✨ AI-generated root cause summary:

This is a false-positive soft lockup report on an arm64 GCE virtual machine rather than an ext4 deadlock or infinite loop. With CONFIG_PREEMPT=y and CONFIG_DEBUG_ATOMIC_SLEEP=y, ext4_mb_new_blocks() runs preemptibly (might_sleep()) and ext4_mb_put_pa() had not even entered do_raw_spin_lock(&pa->pa_lock)β€”it was interrupted immediately upon unmasking IRQs in raw_local_irq_restore() at the end of lock_acquire(). The low IRQ event count (197 hardirq events and zero timer softirqs since fpsimd_restore_current_state at syscall entry) combined with an existing TAINT_SOFTLOCKUP (L) taint shows that CPU 0 did not spin in a kernel loop; instead, the hypervisor paused/preempted vCPU 0 while IRQs were masked in lock_acquire(). Because # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set and arm64 uses the return false stub for kvm_check_and_clear_guest_paused() (include/asm-generic/kvm_para.h), watchdog_timer_fn() (kernel/watchdog.c) measures raw wall-clock counter time via running_clock() and spuriously flags the hypervisor pause as a 21s soft lockup upon IRQ unmasking.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit a041bdbe1f3a:

Technical Root Cause Analysis

This report is a false-positive soft lockup caused by a hypervisor vCPU pause/preemption on an arm64 Google Compute Engine (GCE) virtual machine, rather than a deadlock, atomic loop, or preemption-disable leak in ext4.

1. Why ext4 is not deadlocked or looping

  • No cross-CPU spinlock contention: The NMI backtrace shows CPU 1 is idle (default_idle_call), and CPU 0 had not yet attempted to acquire &pa->pa_lock. In ext4_mb_put_pa() (fs/ext4/mballoc.c:5166), spin_lock(&pa->pa_lock) expands to __raw_spin_lock() -> lock_acquire(). The interrupted PC is at lock_acquire+0x168/0x320 (kernel/locking/lockdep.c:5946, raw_local_irq_restore(flags)), right after __lock_acquire() completed and before do_raw_spin_lock() was reached.
  • No preemption leak or long atomic section: The kernel is built with CONFIG_PREEMPT=y and CONFIG_DEBUG_ATOMIC_SLEEP=y. ext4_mb_new_blocks() (fs/ext4/mballoc.c:6240) calls might_sleep(), and ext4_mb_scan_groups() / ext4_mb_discard_preallocations() call cond_resched(), ensuring preempt_count == 0 on entry to ext4_mb_new_blocks() and throughout ext4_do_writepages(). Any multi-second loop with preemption enabled would have been preempted by migration/0 (softlockup_fn()), preventing a soft lockup; any loop with preempt_count != 0 leaking into cond_resched() or might_sleep() would have triggered BUG: scheduling while atomic.
  • IRQ event trace rules out an active 21-second kernel loop:
    • softirqs last enabled at (26046): fpsimd_restore_current_state (arch/arm64/kernel/fpsimd.c:1781, invoked via arch_exit_to_user_mode_work() on return to userspace) vs. irq event stamp: 26243.
    • Only 197 hardirq enable/disable transitions occurred between user-mode return and the interrupt at lock_acquire(), and zero TIMER_SOFTIRQ (__do_softirq()) executions completed during ksys_pwrite64(). An active 21-second loop across writeback/extent mapping would have produced orders of magnitude more hardirq and timer-softirq events.
  • Prior softlockup taint: The task header shows Tainted: G L ([L]=SOFTLOCKUP) before watchdog_timer_fn() calls add_taint(TAINT_SOFTLOCKUP, ...), indicating an earlier soft lockup had already occurred on this VM.

2. How the false-positive soft lockup occurs in the arm64 watchdog

  1. Inside ext4_mb_put_pa() -> spin_lock(&pa->pa_lock) -> lock_acquire() (kernel/locking/lockdep.c:5938), raw_local_irq_save(flags) masks hardirqs on CPU 0 while executing __lock_acquire().
  2. During this window (or while vCPU 0 was running ext4_mb_put_pa()), the GCE host hypervisor paused/preempted vCPU 0 for ~21 seconds while the arm64 architectural counter (cntvct_el0) continued advancing.
  3. Because # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set, get_timestamp() (kernel/watchdog.c:665) -> running_clock() measures raw elapsed counter time without discounting hypervisor steal/pause time.
  4. Furthermore, arm64 does not implement kvm_check_and_clear_guest_paused(), falling back to the generic stub in include/asm-generic/kvm_para.h:12-15 that unconditionally returns false.
  5. When vCPU 0 resumed and lock_acquire() executed raw_local_irq_restore(flags) (kernel/locking/lockdep.c:5946), the overdue watchdog hrtimer (watchdog_timer_fn() in kernel/watchdog.c:836-893) fired immediately, observed a 21s gap since watchdog_touch_ts/watchdog_report_ts, failed to detect the host pause via kvm_check_and_clear_guest_paused(), and emitted BUG: soft lockup - CPU#0 stuck for 21s!.
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
16e211e8 bisect-cause πŸ’₯ BUG: soft lockup in ext4_file_write_iter 2026/11/24 05:39 2026/11/24 05:39 2026/11/24 06:33 fab64d89
1ea58aa9 assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ BUG: soft lockup in ext4_file_write_iter 2026/11/24 05:39 2026/11/24 05:39 2026/11/24 05:51 fab64d89
▶ ▼ Similar bugs (13)
Kernel Title Rank πŸ›ˆ Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 BUG: soft lockup in ext4_file_write_iter 1 1 1978d 1978d 0/1 auto-closed as invalid on 2021/10/22 22:26
android-5-15 BUG: soft lockup in ext4_file_write_iter 1 6 896d 961d 0/2 auto-obsoleted due to no activity on 2024/09/09 02:51
upstream INFO: rcu detected stall in ext4_file_write_iter (6) ext4 1 syz, C error 8 1321d 1384d 22/29 fixed on 2023/06/08 14:41
upstream INFO: rcu detected stall in ext4_file_write_iter (8) mm 1 3 1074d 1130d 0/29 auto-obsoleted due to no activity on 2024/03/14 12:59
linux-5.15 INFO: rcu detected stall in ext4_file_write_iter 1 1 1098d 1098d 0/3 auto-obsoleted due to no activity on 2024/02/29 20:44
upstream INFO: rcu detected stall in ext4_file_write_iter (10) ext4 1 1 439d 439d 0/29 auto-obsoleted due to no activity on 2025/12/09 11:43
upstream INFO: rcu detected stall in ext4_file_write_iter (3) block 1 5 1932d 2022d 0/29 auto-closed as invalid on 2021/11/07 19:52
upstream INFO: rcu detected stall in ext4_file_write_iter (5) mm 1 3 1672d 1673d 0/29 auto-closed as invalid on 2022/06/25 07:58
linux-6.1 INFO: rcu detected stall in ext4_file_write_iter 1 1 967d 967d 0/3 auto-obsoleted due to no activity on 2024/07/10 06:27
upstream INFO: rcu detected stall in ext4_file_write_iter (7) ext4 mm bpf 1 3 1180d 1222d 23/29 fixed on 2023/10/12 12:47
upstream INFO: rcu detected stall in ext4_file_write_iter (4) mm 1 syz, C unreliable 58 1768d 1797d 0/29 closed as invalid on 2022/02/08 10:32
linux-4.19 INFO: rcu detected stall in ext4_file_write_iter 1 syz, C error 9 1433d 2774d 0/1 upstream: reported C repro on 2019/04/20 13:09
upstream INFO: rcu detected stall in ext4_file_write_iter (9) mm 1 8 890d 954d 0/29 auto-obsoleted due to no activity on 2024/09/14 13:24

Sample crash report:
watchdog: BUG: soft lockup - CPU#0 stuck for 21s! [syz.8.1952:13526]
Modules linked in:
irq event stamp: 26243
hardirqs last  enabled at (26243): [<ffff80008697a49c>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:210 [inline]
hardirqs last  enabled at (26243): [<ffff80008697a49c>] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:221
hardirqs last disabled at (26242): [<ffff80008697a0e0>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:153 [inline]
hardirqs last disabled at (26242): [<ffff80008697a0e0>] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:181
softirqs last  enabled at (26046): [<ffff800080139b20>] local_bh_enable include/linux/bottom_half.h:33 [inline]
softirqs last  enabled at (26046): [<ffff800080139b20>] put_cpu_fpsimd_context arch/arm64/kernel/fpsimd.c:251 [inline]
softirqs last  enabled at (26046): [<ffff800080139b20>] fpsimd_restore_current_state+0x39c/0x9c8 arch/arm64/kernel/fpsimd.c:1781
softirqs last disabled at (26044): [<ffff8000801397c8>] local_bh_disable include/linux/bottom_half.h:20 [inline]
softirqs last disabled at (26044): [<ffff8000801397c8>] get_cpu_fpsimd_context arch/arm64/kernel/fpsimd.c:234 [inline]
softirqs last disabled at (26044): [<ffff8000801397c8>] fpsimd_restore_current_state+0x44/0x9c8 arch/arm64/kernel/fpsimd.c:1774
CPU: 0 UID: 0 PID: 13526 Comm: syz.8.1952 Tainted: G             L      syzkaller #0 PREEMPT 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : lock_acquire+0x168/0x320 arch/arm64/include/asm/irqflags.h:-1
lr : lockdep_recursion_finish kernel/locking/lockdep.c:470 [inline]
lr : lock_acquire+0x148/0x320 kernel/locking/lockdep.c:5945
sp : ffff800096426830
x29: ffff800096426880 x28: 0000000000000000 x27: ffff0000d9a38000
x26: ffff8000898542f8 x25: 0000000000000000 x24: 0000000000000001
x23: 0000000000000000 x22: ffff0000d0150878 x21: ffff8000810c32d4
x20: 0000000000000000 x19: 0000000000000000 x18: 00000000ffffffff
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 00000000001eaaa3 x13: 0000000000000001 x12: 0000000000000003
x11: 0000000000000000 x10: 0000000000000003 x9 : 0000000000000000
x8 : 00000000000000c0 x7 : 0000000000000000 x6 : ffff8000804a121c
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000804b10dc
x2 : 0000000100000001 x1 : ffff0000d9a38000 x0 : 0000000000000000
dump_backtrace(regs = 0000000041e68439 tsk = 0000000000000000)
Call trace:
 __daif_local_irq_restore arch/arm64/include/asm/irqflags.h:175 [inline] (P)
 arch_local_irq_restore arch/arm64/include/asm/irqflags.h:195 [inline] (P)
 lock_acquire+0x168/0x320 kernel/locking/lockdep.c:5946 (P)
 __raw_spin_lock include/linux/spinlock_api_smp.h:190 [inline]
 _raw_spin_lock+0x48/0x60 kernel/locking/spinlock.c:173
 spin_lock include/linux/spinlock.h:347 [inline]
 ext4_mb_put_pa fs/ext4/mballoc.c:5166 [inline]
 ext4_mb_release_context fs/ext4/mballoc.c:6093 [inline]
 ext4_mb_new_blocks+0x178c/0x3b60 fs/ext4/mballoc.c:6353
 ext4_ext_map_blocks+0xfc4/0x3ffc fs/ext4/extents.c:4469
 ext4_map_create_blocks+0x100/0x4a0 fs/ext4/inode.c:697
 ext4_map_blocks+0x860/0xff8 fs/ext4/inode.c:942
 mpage_map_one_extent fs/ext4/inode.c:2505 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2601 [inline]
 ext4_do_writepages+0x12b8/0x3618 fs/ext4/inode.c:3077
 ext4_writepages+0x198/0x2dc fs/ext4/inode.c:3171
 do_writepages+0x284/0x47c mm/page-writeback.c:2560
 filemap_writeback+0x230/0x2bc mm/filemap.c:387
 filemap_fdatawrite_range mm/filemap.c:412 [inline]
 file_write_and_wait_range+0xb0/0x138 mm/filemap.c:786
 ext4_sync_file+0x214/0xad8 fs/ext4/fsync.c:145
 vfs_fsync_range+0x120/0x140 fs/sync.c:186
 generic_write_sync include/linux/fs.h:2695 [inline]
 ext4_buffered_write_iter+0x350/0x438 fs/ext4/file.c:378
 ext4_file_write_iter+0x1f4/0x1478 fs/ext4/file.c:-1
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x51c/0xa0c fs/read_write.c:687
 ksys_pwrite64+0x168/0x21c fs/read_write.c:794
 __do_sys_pwrite64 fs/read_write.c:802 [inline]
 __se_sys_pwrite64 fs/read_write.c:799 [inline]
 __arm64_sys_pwrite64+0xa8/0xc0 fs/read_write.c:799
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
 el0_svc+0x60/0x1d8 arch/arm64/kernel/entry-common.c:797
 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:816
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1 skipped: idling at __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:26 [inline]
NMI backtrace for cpu 1 skipped: idling at arch_local_irq_enable arch/arm64/include/asm/irqflags.h:48 [inline]
NMI backtrace for cpu 1 skipped: idling at default_idle_call+0xa0/0xb8 kernel/sched/idle.c:129

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/24 05:39 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a041bdbe1f3a e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: soft lockup in ext4_file_write_iter
* Struck through repros no longer work on HEAD.