VDB

CVE-2025-21767

CVE-2025-21767 PUBLISHED

clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context

Reported by linux · Published February 27, 2025

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-livepatch-6.1.129-138.220Amazon Linux1.0-0.amzn2023
kernel-modules-extra-commonAmazon Linux6.1.129-138.220.amzn2023
bpftoolAmazon Linux6.1.129-138.220.amzn2023
kernel-toolsAmazon Linux6.1.129-138.220.amzn2023
kernel-headersAmazon Linux6.1.129-138.220.amzn2023
kernel-libbpf-develAmazon Linux6.1.129-138.220.amzn2023
linux_kernellinux6.13.4, 6.12.16, 6.6.79, 6.1.129, 5.15.179, 5.13, 5.10.235

Affected products

VendorProductVersions
LinuxLinuxd9b40ebd448e437ffbc65f013836f98252279a82, 7560c02bdffb7c52d1457fa551b9e745d4b9e754, 7560c02bdffb7c52d1457fa551b9e745d4b9e754
LinuxLinux5.14, 0, 5.10.235
amazon:2023kernel-livepatch-6.1.129-138.2200
SiemensSIPLUS S7-1500 CPU 1518-4 PN/DP MFP3.1.5
amazon:2023kernel-modules-extra-common0
amazon:2023bpftool0
amazon:2023kernel-tools0
amazon:2023kernel-headers0
amazon:2023kernel-libbpf-devel0
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystem0
linuxlinux_kernel5.10.50, 5.14, 5.14
amazon:2023kernel-tools-devel0
amazon:2023kernel-libbpf-static0
SiemensSIMATIC S7-1500 CPU 1518-4 PN/DP MFP3.1.5
amazon:2023perf0
SiemensSIMATIC S7-1500 CPU 1518F-4 PN/DP MFP3.1.5
amazon:2023kernel0
amazon:2023kernel-devel0
amazon:2023python3-perf0
amazon:2023kernel-libbpf0

…and 2 more

Timeline

  • Feb 26, 2025 CVE Published
  • Feb 27, 2025 EPSS Score (30 in total, the first dated here)
  • Feb 28, 2025 Coalition ESS Score (13 in total, the first dated here)
  • Dec 18, 2025 PoC Published
  • Dec 22, 2025 Security Advisory (392 in total, the first dated here)
  • Apr 29, 2026 Distribution Patch (345 in total, the first dated here)
  • Nov 11, 2026 CVE Updated

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2025-21767
vulnetix vdb fixes CVE-2025-21767

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-21767/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›