Technical Analysis
Crash Site and Execution State
On CPU 1, the soft lockup watchdog (watchdog_timer_fn() in kernel/watchdog.c) fired immediately after lock_acquire() (kernel/locking/lockdep.c:5946) executed raw_local_irq_restore(flags) (inlined __daif_local_irq_restore() in arch/arm64/include/asm/irqflags.h:175).
The call path on CPU 1 is:
smc_release() (net/smc/af_smc.c:361) acquires the SMC socket lock via lock_sock_nested() / lock_sock() (net/core/sock.c:3929) and calls __smc_release().
__smc_release() (net/smc/af_smc.c:310) takes the fallback branch (smc->use_fallback == true) and calls smc_restore_fallback_changes() -> smc_fback_restore_callbacks() (net/smc/af_smc.c:268).
smc_fback_restore_callbacks() calls write_lock_bh(&clcsk->sk_callback_lock) (__raw_write_lock_bh() in include/linux/rwlock_api_smp.h:220-222):
__local_bh_disable_ip() disables softirqs (recorded at irq event stamp: 1918).
rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_) invokes lock_acquire(), before LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock) is reached.
- Inside
lock_acquire() (kernel/locking/lockdep.c:5938-5946), raw_local_irq_save(flags) disables hardirqs, __lock_acquire() executes, and raw_local_irq_restore(flags) re-enables hardirqs (pstate shows daif unmasked). At that exact instruction, the pending softlockup hrtimer fires and reports BUG: soft lockup - CPU#1 stuck for 33s!.
Meanwhile, CPU 0 (bpf_int_jit_compile() -> bpf_jit_binary_pack_finalize() -> aarch64_insn_copy() -> __text_poke() -> flush_icache_range() -> kick_all_cpus_sync()) is spinning in csd_lock_wait() inside smp_call_function_many_cond() (kernel/smp.c:1028), waiting for CPU 1 to acknowledge the context-synchronization IPI that could not be delivered while CPU 1 had hardirqs disabled (or was stalled).
Hypotheses Ruled Out
- Defect or loop in
net/smc/af_smc.c:
- The lockdep irq-event log shows
softirqs last enabled at (1916) and hardirqs last enabled at (1917) at the end of lock_sock_nested(), followed immediately by softirqs last disabled at (1918) in smc_fback_restore_callbacks(). Between lock_sock_nested() (which calls might_sleep() and enables preemption/BH/IRQs on spin_unlock_bh(&sk->sk_lock.slock)) and smc_fback_restore_callbacks(), __smc_release() executes linearly with no loops, no locks (note kernel_sock_shutdown() was not entered as it would advance irq_events), and no preemption-disabling sections.
- CPU 1 had not yet reached
do_raw_write_lock() on clcsk->sk_callback_lock, so contention or deadlock on sk_callback_lock is ruled out.
CONFIG_KASAN=y is enabled, and kasan_check_byte(lock) at kernel/locking/lockdep.c:5916 passed with no UAF/OOB on clcsk.
- Deadlock on lockdep's
graph_lock (__lock):
- There are only two CPUs (CPU 1's
trigger_allbutcpu_cpu_backtrace() only sends NMI to CPU 0), and CPU 0 is in csd_lock_wait() (which does not hold lockdep_lock). Moreover, CPU 1 actually completed __lock_acquire() and lockdep_recursion_finish() before reaching raw_local_irq_restore().
Inconclusive Mechanism for the 33-Second Delay
Because CONFIG_PREEMPT=y is enabled and preempt_count and hardirqs were clear at stamp 1917 right before smc_fback_restore_callbacks(), the migration/1 stopper (softlockup_fn()) could not have been blocked from updating watchdog_touch_ts prior to lock_acquire(). The 33-second elapsed time therefore occurred between raw_local_irq_save(flags) and raw_local_irq_restore(flags) inside lock_acquire(), for which two explanations remain possible from the report alone:
- Hypervisor / host vCPU stall on GCE arm64: If the host preempted/paused vCPU 1 (or the VM) while CPU 1 was inside
lock_acquire() with hardirqs disabled (and CPU 0 was spinning in kick_all_cpus_sync() waiting on CPU 1), running_clock() continues to advance on arm64 while paused. Unlike x86 KVM, kvm_check_and_clear_guest_paused() in watchdog_timer_fn() (kernel/watchdog.c:841) resolves to the include/asm-generic/kvm_para.h stub returning false on arm64, so host steal time is reported as a guest soft lockup as soon as raw_local_irq_restore() re-enables IRQs.
- Extreme latency inside
__lock_acquire(): Lockdep graph validation (validate_chain(), check_noncircular(), check_redundant()) or save_trace() (arch_stack_walk()) running under CONFIG_KASAN=y and CONFIG_LOCKDEP=y with interrupts disabled, though graph traversal alone does not normally consume 33 seconds without host contention.