# CVE-2025-21767: clocksource: Use migrate\_disable() to avoid calling get\_random\_u32() in atomic context

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-02-27T02:18:17.067Z
- **Modified:** 2026-11-05T21:17:42.467Z

## Who should check

- Anyone running Linux \>= d9b40ebd448e437ffbc65f013836f98252279a82, \< d9c217fadfcff7a8df58567517d1e4253f3fd243; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 60f54f0d4ea530950549a8263e6fdd70a40490a4; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 852805b6cbdb69c298a8fc9fbe79994c95106e04; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 8783ceeee797d9aa9cfe150690fb9d0bac8cc459; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 0fb534187d2355f6c8f995321e76d1ccd1262ac1; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 6bb05a33337b2c842373857b63de5c9bf1ae2a09; 193e14e68e907b2a7a936a7726accbaa4df25a4d; 155d3c5d24ee13cafa6236b49fc02b240a511d59; \>= 5.10.50, \< 5.10.235; …
- Anyone running Linux 5.14

## Description

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 and fixed versions

- Linux: \>= d9b40ebd448e437ffbc65f013836f98252279a82, \< d9c217fadfcff7a8df58567517d1e4253f3fd243; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 60f54f0d4ea530950549a8263e6fdd70a40490a4; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 852805b6cbdb69c298a8fc9fbe79994c95106e04; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 8783ceeee797d9aa9cfe150690fb9d0bac8cc459; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 0fb534187d2355f6c8f995321e76d1ccd1262ac1; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 6bb05a33337b2c842373857b63de5c9bf1ae2a09; 193e14e68e907b2a7a936a7726accbaa4df25a4d; 155d3c5d24ee13cafa6236b49fc02b240a511d59; \>= 5.10.50, \< 5.10.235; … (cvelist)
- Linux: 5.14 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21767. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21767.md
Affected: Linux >= d9b40ebd448e437ffbc65f013836f98252279a82, < d9c217fadfcff7a8df58567517d1e4253f3fd243; >= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, < 60f54f0d4ea530950549a8263e6fdd70a40490a4; >= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, < 852805b6cbdb69c298a8fc9fbe79994c95106e04; >= 7560c02bdffb7c52d1457fa…
Fixed in: Linux 60f54f0d4ea530950549a8263e6fdd70a40490a4, Linux 852805b6cbdb69c298a8fc9fbe79994c95106e04, Linux 8783ceeee797d9aa9cfe150690fb9d0bac8cc459, Linux 0fb534187d2355f6c8f995321e76d1ccd1262ac1, Linux 6bb05a33337b2c842373857b63de5c9bf1ae2a09, Linux 5.10.235

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21767 being exploited?

There is no confirmed exploitation: CVE-2025-21767 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21767?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21767?

Linux \>= d9b40ebd448e437ffbc65f013836f98252279a82, \< d9c217fadfcff7a8df58567517d1e4253f3fd243; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 60f54f0d4ea530950549a8263e6fdd70a40490a4; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 852805b6cbdb69c298a8fc9fbe79994c95106e04; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 8783ceeee797d9aa9cfe150690fb9d0bac8cc459; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 0fb534187d2355f6c8f995321e76d1ccd1262ac1; \>= 7560c02bdffb7c52d1457fa551b9e745d4b9e754, \< 6bb05a33337b2c842373857b63de5c9bf1ae2a09; 193e14e68e907b2a7a936a7726accbaa4df25a4d; 155d3c5d24ee13cafa6236b49fc02b240a511d59; \>= 5.10.50, \< 5.10.235; …; Linux 5.14.

### Is there a fix for CVE-2025-21767?

Yes. Fixed in Linux 60f54f0d4ea530950549a8263e6fdd70a40490a4, Linux 852805b6cbdb69c298a8fc9fbe79994c95106e04, Linux 8783ceeee797d9aa9cfe150690fb9d0bac8cc459, Linux 0fb534187d2355f6c8f995321e76d1ccd1262ac1, Linux 6bb05a33337b2c842373857b63de5c9bf1ae2a09, Linux 5.10.235. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-21767?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/d9c217fadfcff7a8df58567517d1e4253f3fd243>
- patch: <https://git.kernel.org/stable/c/60f54f0d4ea530950549a8263e6fdd70a40490a4>
- patch: <https://git.kernel.org/stable/c/852805b6cbdb69c298a8fc9fbe79994c95106e04>
- patch: <https://git.kernel.org/stable/c/8783ceeee797d9aa9cfe150690fb9d0bac8cc459>
- patch: <https://git.kernel.org/stable/c/cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa>
- patch: <https://git.kernel.org/stable/c/0fb534187d2355f6c8f995321e76d1ccd1262ac1>
- patch: <https://git.kernel.org/stable/c/6bb05a33337b2c842373857b63de5c9bf1ae2a09>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-082556.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-784472.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21767>

HTML: <https://flawdb.com/CVE-2025-21767> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21767>
