syzbot
BUG: soft lockup in sys_fallocate
Status:
moderation: reported on 2026/11/30 13:44
Subsystems:
arch
kvm
Labels:
prio:low
[Documentation on labels]
Reported-by: syzbot+9d5563749cc6d809471c@syzkaller.appspotmail.com
First crash: 1h13m, last: 1h13m
✨ AI-generated root cause summary:
This is a false-positive soft lockup on an arm64 virtualized guest caused by hypervisor vCPU preemption/stall time not being excluded by the watchdog detector. While CPU 0 was briefly inside lockdep's lock_acquire() (called from read_lock(&ei->i_prealloc_lock) in ext4_mb_use_preallocated()) with interrupts masked, vCPU 0 was stalled for ~65s, preventing interrupt delivery (including CPU 1's kick_all_cpus_sync() IPI in csd_lock_wait()). Once vCPU 0 resumed and lock_acquire() unmasked interrupts via raw_local_irq_restore(), watchdog_timer_fn() fired and saw a 65s delta because arm64 uses the weak running_clock() returning wall-clock local_clock() and the no-op kvm_check_and_clear_guest_paused() stub returning false.
▶
▼
✨ Full AI root cause analysis
Root Cause Analysis
This soft lockup report on CPU 0 (watchdog: BUG: soft lockup - CPU#0 stuck for 65s! [syz.5.830:10379]) is not caused by a deadlock or infinite loop in ext4 or lockdep. Instead, it is a spurious (false-positive) soft lockup resulting from an external ~65-second vCPU stall/hypervisor preemption while CPU 0 had interrupts masked inside lock_acquire(), combined with arm64's lack of hypervisor paused/steal-time exclusion in the softlockup watchdog.
Technical Breakdown & Evidence
-
No deadlock or preemption-disabled loop in ext4:
- Task
syz.5.830 entered fallocate -> ext4_fallocate() -> ext4_do_fallocate() -> ext4_alloc_file_blocks() -> ext4_map_blocks() -> ext4_map_create_blocks() -> ext4_ext_map_blocks() -> ext4_mb_new_blocks() (fs/ext4/mballoc.c:6300) -> ext4_mb_use_preallocated() (fs/ext4/mballoc.c:4896).
ext4_mb_new_blocks() calls might_sleep() at fs/ext4/mballoc.c:6240. With CONFIG_PREEMPT=y and CONFIG_DEBUG_ATOMIC_SLEEP=y enabled in this kernel, reaching line 6300 without an atomic-sleep splat confirms that preempt_count() == 0 and interrupts were enabled immediately prior to entering ext4_mb_use_preallocated().
syz.5.830 only recorded 65 IRQ-trace events (irq event stamp: 41763) since fpsimd_restore_current_state() (arch/arm64/kernel/fpsimd.c:1780, called on return to userspace from arch_exit_to_user_mode_work()) at event 41698, with the most recent hardirq enable at 41763 inside lookup_bh_lru() (fs/buffer.c:1291). Thus, syz.5.830 was not spinning in ext4_alloc_file_blocks() for 65 seconds, nor could a preempt_count() == 0 loop prevent migration/0 (stop_sched_class, running softlockup_fn()) from preempting it under CONFIG_PREEMPT=y.
- At
fs/ext4/mballoc.c:4896, ext4_mb_use_preallocated() calls read_lock(&ei->i_prealloc_lock) (__raw_read_lock() in include/linux/rwlock_api_smp.h:162-164). CPU 0 had not reached LOCK_CONTENDED(..., do_raw_read_lock) yet, so it was not spinning on ei->i_prealloc_lock.
-
Exact interruption point in lock_acquire() and correlation with CPU 1:
- CPU 0's
pc is at lock_acquire+0x168/0x320 (arch_local_irq_restore() via raw_local_irq_restore(flags) at kernel/locking/lockdep.c:5946), immediately after lockdep_recursion_finish() (lr at kernel/locking/lockdep.c:5945).
lock_acquire() masks interrupts via raw_local_irq_save(flags) (kernel/locking/lockdep.c:5938), runs __lock_acquire(), and unmasks interrupts at line 5946 (raw_local_irq_restore(flags)). The watchdog timer IRQ fired on the exact instruction unmasking IRQs.
- Simultaneously, the backtrace for CPU 1 (
kworker/1:9) shows jump_label_update_timeout() (kernel/jump_label.c:325) -> __static_key_slow_dec() -> arch_jump_label_transform_apply() -> kick_all_cpus_sync() -> smp_call_function_many_cond() -> csd_lock_wait() (kernel/smp.c:389). CPU 1 was blocked waiting for CPU 0 to acknowledge the synchronization IPI because vCPU 0 was stalled/had IRQs masked during the ~65-second interval.
-
Missing hypervisor pause / steal-time accounting on arm64:
- In
kernel/watchdog.c:836-873, watchdog_timer_fn() computes now = get_timestamp() (running_clock() >> 30LL, kernel/watchdog.c:667) and calls kvm_check_and_clear_guest_paused() (kernel/watchdog.c:841) before evaluating is_softlockup(touch_ts, period_ts, now).
- On
arm64, running_clock() (kernel/sched/clock.c:508) is not overridden by architecture/paravirt code and falls back to local_clock(), which continues advancing with wall-clock time while the guest vCPU is paused/preempted by the hypervisor.
- Likewise,
arm64 uses the generic kvm_check_and_clear_guest_paused() stub (include/asm-generic/kvm_para.h:12), which unconditionally returns false.
- Consequently, when vCPU 0 resumed from the ~65-second stall inside
lock_acquire() and unmasked IRQs at raw_local_irq_restore(), watchdog_timer_fn() observed now - watchdog_touch_ts == 65s and reported a soft lockup.
Sample crash report:
* Struck through repros no longer work on HEAD.