CVE-2025-21767 json
clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context
published 2025-02-27 20 mo ago modified 2026-11-05 3 d ago also EUVD-2025-5160
- cvss
- 5.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 7%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 5.10.235, 5.13, 5.14, 5.15.179, 6.1.129, 6.6.79, 6.12.16, 6.13.4, 6.14
- linux Debian 12 6.1.129-1
- linux Debian 14, Debian 13 6.12.16-1
debian advisories DEBIAN-CVE-2025-21767
- linux Ubuntu 22.04 LTS 5.15.0-140.150
- linux Ubuntu 24.04 LTS 6.8.0-78.78
- linux-aws Ubuntu 22.04 LTS 5.15.0-1084.91
- linux-aws Ubuntu 24.04 LTS 6.8.0-1035.37
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1083.92
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1036.38
- linux-gke Ubuntu 22.04 LTS 5.15.0-1081.87
- linux-gke Ubuntu 24.04 LTS 6.8.0-1032.36
ubuntu advisories UBUNTU-CVE-2025-21767
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-coco SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.21.coco15sp6.1
- kernel-syms-coco SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.21.coco15sp6.1
- kernel-coco_debug SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.21.coco15sp6.1
- kernel-source-coco SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.21.coco15sp6.1
- kernel-source Linux Micro 6.1, Linux Micro 6.0 6.4.0-28.1
- kernel-default Linux Micro 6.1, Linux Micro 6.0 6.4.0-28.1
- kernel-kvmsmall Linux Micro 6.1, Linux Micro 6.0 6.4.0-28.1
- kernel-default-base Linux Micro 6.1, Linux Micro 6.0 6.4.0-28.1.21.6
suse advisories SUSE-SU-2025:01919-1SUSE-SU-2025:20192-1SUSE-SU-2025:20270-1SUSE-SU-2025:20190-1SUSE-SU-2025:20260-1SUSE-SU-2025:0955-1
- git.kernel.org/stable/c/d9c217fadfcff7a8df58567517d1e4253f3fd243 commit
- git.kernel.org/stable/c/60f54f0d4ea530950549a8263e6fdd70a40490a4 commit
- git.kernel.org/stable/c/852805b6cbdb69c298a8fc9fbe79994c95106e04 commit
- git.kernel.org/stable/c/8783ceeee797d9aa9cfe150690fb9d0bac8cc459 commit
- git.kernel.org/stable/c/cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa commit
- git.kernel.org/stable/c/0fb534187d2355f6c8f995321e76d1ccd1262ac1 commit
- git.kernel.org/stable/c/6bb05a33337b2c842373857b63de5c9bf1ae2a09 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-21767 updated cvss 4.4
kernel: clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 moreaffected: no fix available
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
cisa ICSA-26-295-16 updated cvss 5.5
Siemens SIMATIC S7-1500 TM MFP
-
Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystemaffected: mitigation, no fix available
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
cisa ICSA-25-162-05 updated cvss 5.5
Siemens SIMATIC S7-1500 CPU family
-
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) >= 3.1.5 Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) >= 3.1.5 Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) >= 3.1.5 Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) >= 3.1.5 Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) >= 3.1.5affected: mitigation, no fix available
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 3 d ago
Exploit prediction
0.18% chance of exploitation in the next 30 days, higher than 7% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
- Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP
- Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP
- Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem
- Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP
Classification
- Weakness
-
- CWE-667 Improper Locking
- Technology feeds
References
-
git.kernel.org
/stable/c/d9c217fadfcff7a8df58567517d1e4253f3fd243
patch
-
git.kernel.org
/stable/c/60f54f0d4ea530950549a8263e6fdd70a40490a4
patch
-
git.kernel.org
/stable/c/852805b6cbdb69c298a8fc9fbe79994c95106e04
patch
-
git.kernel.org
/stable/c/8783ceeee797d9aa9cfe150690fb9d0bac8cc459
patch
-
git.kernel.org
/stable/c/cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa
patch
-
git.kernel.org
/stable/c/0fb534187d2355f6c8f995321e76d1ccd1262ac1
patch
-
git.kernel.org
/stable/c/6bb05a33337b2c842373857b63de5c9bf1ae2a09
patch
- lists.debian.org /debian-lts-announce/2025/05/msg00030.html
- lists.debian.org /debian-lts-announce/2025/03/msg00028.html
- cert-portal.siemens.com /productcert/html/ssa-082556.html
- cert-portal.siemens.com /productcert/html/ssa-784472.html
Sources
- CVE List CVE-2025-21767
- NVD CVE-2025-21767
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.