Junglewise Threat Intelligence

CVE-2025-21767: Linux Kernel improper locking in clocksource verify_percpu

CVE-2025-21767 · Severity: medium · CVSS 5.5 · Published 2025-02-27

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability in the Linux kernel's timekeeping system can cause system instability or crashes on specialized Real-Time (PREEMPT_RT) systems. The issue occurs when the system attempts to verify clock synchronization across different processors while in a state that does not allow certain background tasks to run. This can lead to a kernel panic or "hang," potentially disrupting critical operations that rely on high-precision timing.

Technical details

A deadlock or invalid context bug exists in the Linux kernel's clocksource verification logic when running on PREEMPT_RT kernels. The function clocksource_verify_choose_cpus() was being invoked with preemption disabled (atomic context), but it calls get_random_u32(), which may attempt to acquire sleeping locks (batched_entropy_32 or base_crng.lock) in the random driver. This violation of atomic context constraints triggers a kernel BUG. The fix replaces preempt_disable() with migrate_disable() during the CPU selection phase to ensure smp_processor_id() remains stable without entering a full atomic state that forbids sleeping locks. Patch availability is confirmed across multiple stable kernel branches.

Affected products

  • Linux Linux Kernel 5.10.50 to 5.10.235, 5.12.17 to 5.13, 5.13.2 to 5.15.179, 5.16 to 6.1.129, 6.2 to 6.6.79, 6.7 to 6.12.16, 6.13 to 6.13.4

Timeline

  • 2025-01-31: other: Patch submitted by developer
  • 2025-02-27: disclosed: CVE published

References

Related threats