In the Linux kernel, the following vulnerability has been resolved:
clocksource: Use migratedisable() to avoid calling getrandom_u32() in atomic context
The following bug report happened with a PREEMPT_RT kernel:
BUG: sleeping function called from invalid context at kernel/locking/spinlockrt.c:48 inatomic(): 1, irqsdisabled(): 0, nonblock: 0, pid: 2012, name: kwatchdog preemptcount: 1, expected: 0 RCU nest depth: 0, expected: 0 getrandomu32+0x4f/0x110 clocksourceverifychoosecpus+0xab/0x1a0 clocksourceverifypercpu.part.0+0x6b/0x330 clocksourcewatchdogkthread+0x193/0x1a0
It is due to the fact that clocksourceverifychoosecpus() is invoked with preemption disabled. This function invokes getrandomu32() to obtain random numbers for choosing CPUs. The batchedentropy32 local lock and/or the basecrng.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 migratedisable() to allow smpprocessorid() to be reliably used without introducing atomic context. preemptdisable() is then called after clocksourceverifychoose_cpus() but before the clocksource measurement is being run to avoid introducing unexpected latency.
[
{
"id": "CVE-2025-21767-033d183d",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1601.0,
"function_hash": "32002039626609814852332770007598954387"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0fb534187d2355f6c8f995321e76d1ccd1262ac1",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-05f6bb93",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1674.0,
"function_hash": "244233505620481033801028889899000592170"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d9c217fadfcff7a8df58567517d1e4253f3fd243",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-0bbb40a6",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1601.0,
"function_hash": "32002039626609814852332770007598954387"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@852805b6cbdb69c298a8fc9fbe79994c95106e04",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-2e4f319d",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1601.0,
"function_hash": "32002039626609814852332770007598954387"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@60f54f0d4ea530950549a8263e6fdd70a40490a4",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-3f0d7957",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8783ceeee797d9aa9cfe150690fb9d0bac8cc459",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-40dc8f50",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@852805b6cbdb69c298a8fc9fbe79994c95106e04",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-7bfbec74",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-80b15c60",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1601.0,
"function_hash": "32002039626609814852332770007598954387"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6bb05a33337b2c842373857b63de5c9bf1ae2a09",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-86c3a837",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@60f54f0d4ea530950549a8263e6fdd70a40490a4",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-8a9561fd",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0fb534187d2355f6c8f995321e76d1ccd1262ac1",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-91ed0c55",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1601.0,
"function_hash": "32002039626609814852332770007598954387"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8783ceeee797d9aa9cfe150690fb9d0bac8cc459",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-a14ba9a6",
"target": {
"file": "kernel/time/clocksource.c",
"function": "clocksource_verify_percpu"
},
"digest": {
"length": 1601.0,
"function_hash": "32002039626609814852332770007598954387"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc3d79e7c806cb57d71c28a4a35e7d7fb3265faa",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-e6d06934",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d9c217fadfcff7a8df58567517d1e4253f3fd243",
"signature_version": "v1"
},
{
"id": "CVE-2025-21767-f2129114",
"target": {
"file": "kernel/time/clocksource.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"144977462441847919678971005766009430030",
"82070800254342888254577498266939402000",
"22773103970466121740147313205313621384",
"50948055621409444793259965267112315432",
"31535152720112515843493178183807051446",
"216582942040361932347766396984611529733",
"10698282046936355509367491823883916880",
"320675019903911167303950549587581558846",
"186705990526229469367877822193116928696",
"69069295834770358372227837933934765656",
"183148665736636458264676031362056846089",
"170718584600308313262471056384911064125",
"299009913744596562580774238309642976354",
"149361240789130334511093762412570157702",
"226161060028285833220137086965475709182"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6bb05a33337b2c842373857b63de5c9bf1ae2a09",
"signature_version": "v1"
}
]