Cloudanix VulnDB

CVE-2025-21767

Medium · 5.5

CVSS

5.5

EPSS

0.2%

Published

Feb 27, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A timing-related problem in the Linux kernel could cause crashes on computers that need very precise real-time behavior.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Denial Of Service
Component
OS kernel
Class
Race Condition
Remediation
Patch
Effort
Low
Patch risk
Low

What it actually does

The flaw occurs because clocksource_verify_choose_cpus() disables preemption before calling get_random_u32(), causing acquisition of sleeping locks (batched_entropy_32 local lock and base_crng.lock) from atomic context on PREEMPT_RT kernels, triggering a sleeping-function-in-atomic-context BUG.

Why it matters to the business

Systems running PREEMPT_RT kernels may experience unexpected watchdog thread crashes or kernel instability during clocksource verification, leading to degraded availability on latency-sensitive real-time deployments.

How an attack unfolds

An attacker with local access triggers repeated clocksource_watchdog_kthread execution under preemption-disabled conditions to force the invalid sleeping lock acquisition and induce a kernel BUG, though no public weaponization or threat actor campaigns are associated with this specific issue.

How to fix it

Upgrade to a fixed kernel version such as 5.10.235 or the commit d9c217fadfcff7a8df58567517d1e4253f3fd243; rebuild and deploy the patched kernel on all PREEMPT_RT systems.

How to confirm the fix worked

Boot the updated kernel on a PREEMPT_RT configuration, confirm clocksource_watchdog_kthread completes without BUG reports in dmesg, and verify the migrate_disable() change is present in clocksource.c.

Typical attack path

  1. Obtain local user access on a PREEMPT_RT Linux system
  2. Wait for or induce clocksource_watchdog_kthread to run clocksource_verify_percpu
  3. Trigger get_random_u32() while preemption is disabled
  4. Cause acquisition of RT sleeping locks from atomic context
  5. Induce kernel BUG and potential watchdog-induced instability

How to detect it

Search kernel logs (dmesg, journalctl) for BUG: sleeping function called from invalid context messages referencing get_random_u32 or clocksource_verify_choose_cpus; examine stack traces containing clocksource_watchdog_kthread on PREEMPT_RT systems.

What your security team should do

  • Prioritize patching PREEMPT_RT production kernels within standard maintenance windows
  • Add kernel version checks to configuration management and CI pipelines
  • Monitor dmesg and kernel logs for sleeping-function-in-atomic-context messages on RT systems
  • Test real-time workloads after upgrade to confirm latency characteristics remain acceptable

The record

In the Linux kernel, the following vulnerability has been resolved: clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context The following bug report happened with a PREEMPT_RT kernel: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2012, name: kwatchdog preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 get_random_u32+0x4f/0x110 clocksource_verify_choose_cpus+0xab/0x1a0 clocksource_verify_percpu.part.0+0x6b/0x330 clocksource_watchdog_kthread+0x193/0x1a0 It is due to the fact that clocksource_verify_choose_cpus() is invoked with preemption disabled. This function invokes get_random_u32() to obtain random numbers for choosing CPUs. The batched_entropy_32 local lock and/or the base_crng.lock spinlock in driver/char/random.c will be acquired during the call. In PREEMPT_RT kernel, they are both sleeping locks and so cannot be acquired in atomic context. Fix this problem by using migrate_disable() to allow smp_processor_id() to be reliably used without introducing atomic context. preempt_disable() is then called after clocksource_verify_choose_cpus() but before the clocksource measurement is being run to avoid introducing unexpected latency.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 linux 0 No fix
Debian:11 linux-6.1 0 6.1.129-1~deb11u1
Debian:12 linux 0 No fix
Debian:13 linux 0 No fix
Debian:13 linux 0 6.12.16-1
Linux Kernel 0 5.10.235
SUSE:Linux Enterprise High Availability Extension 15 SP6 kernel-default 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-default 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_9 0 1-150600.1.3.2
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_9 0 1-150600.13.3.4
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-64kb 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default-base 0 6.4.0-150600.23.42.2.150600.12.18.4
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-source 0 6.4.0-150600.23.42.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-zfcpdump 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-coco 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-coco_debug 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-source-coco 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 kernel-syms-coco 0 6.4.0-15061.21.coco15sp6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-docs 0 6.4.0-150600.23.42.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-obs-build 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-source 0 6.4.0-150600.23.42.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-syms 0 6.4.0-150600.23.42.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 kernel-default 0 6.4.0-150600.23.42.2
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-azure 0 6.4.0-150600.8.31.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-source-azure 0 6.4.0-150600.8.31.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-syms-azure 0 6.4.0-150600.8.31.1
SUSE:Linux Enterprise Workstation Extension 15 SP6 kernel-default 0 6.4.0-150600.23.42.2
SUSE:Real Time Module 15 SP6 kernel-rt 0 6.4.0-150600.10.29.1
SUSE:Real Time Module 15 SP6 kernel-rt_debug 0 6.4.0-150600.10.29.1
SUSE:Real Time Module 15 SP6 kernel-source-rt 0 6.4.0-150600.10.29.1
SUSE:Real Time Module 15 SP6 kernel-syms-rt 0 6.4.0-150600.10.29.1
Ubuntu:24.10 linux-aws 0 6.11.0-1014.15
openSUSE:Leap 15.6 dtb-aarch64 0 6.4.0-150600.23.42.1
openSUSE:Leap 15.6 kernel-64kb 0 6.4.0-150600.23.42.2
openSUSE:Leap 15.6 kernel-azure 0 6.4.0-150600.8.31.1
openSUSE:Leap 15.6 kernel-debug 0 6.4.0-150600.23.42.2
openSUSE:Leap 15.6 kernel-default 0 6.4.0-150600.23.42.2
openSUSE:Leap 15.6 kernel-default-base 0 6.4.0-150600.23.42.2.150600.12.18.4
openSUSE:Leap 15.6 kernel-docs 0 6.4.0-150600.23.42.1
openSUSE:Leap 15.6 kernel-kvmsmall 0 6.4.0-150600.23.42.2
openSUSE:Leap 15.6 kernel-obs-build 0 6.4.0-150600.23.42.2
openSUSE:Leap 15.6 kernel-obs-qa 0 6.4.0-150600.23.42.1
openSUSE:Leap 15.6 kernel-rt 0 6.4.0-150600.10.29.1
openSUSE:Leap 15.6 kernel-rt_debug 0 6.4.0-150600.10.29.1
openSUSE:Leap 15.6 kernel-source 0 6.4.0-150600.23.42.1
openSUSE:Leap 15.6 kernel-source-azure 0 6.4.0-150600.8.31.1
openSUSE:Leap 15.6 kernel-source-rt 0 6.4.0-150600.10.29.1
openSUSE:Leap 15.6 kernel-syms 0 6.4.0-150600.23.42.1
openSUSE:Leap 15.6 kernel-syms-azure 0 6.4.0-150600.8.31.1
openSUSE:Leap 15.6 kernel-syms-rt 0 6.4.0-150600.10.29.1
openSUSE:Leap 15.6 kernel-zfcpdump 0 6.4.0-150600.23.42.2

Related vulnerabilities