CVE-2025-40346

Source
https://cve.org/CVERecord?id=CVE-2025-40346
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40346.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-40346
Downstream
Related
Published
2025-12-16T13:30:20.395Z
Modified
2026-03-12T02:19:07.248697Z
Summary
arch_topology: Fix incorrect error check in topology_parse_cpu_capacity()
Details

In the Linux kernel, the following vulnerability has been resolved:

archtopology: Fix incorrect error check in topologyparsecpucapacity()

Fix incorrect use of PTRERRORZERO() in topologyparsecpucapacity() which causes the code to proceed with NULL clock pointers. The current logic uses !PTRERRORZERO(cpuclk) which evaluates to true for both valid pointers and NULL, leading to potential NULL pointer dereference in clkgetrate().

Per include/linux/err.h documentation, PTRERROR_ZERO(ptr) returns: "The error code within @ptr if it is an error pointer; 0 otherwise."

This means PTRERRORZERO() returns 0 for both valid pointers AND NULL pointers. Therefore !PTRERRORZERO(cpuclk) evaluates to true (proceed) when cpuclk is either valid or NULL, causing clkgetrate(NULL) to be called when ofclkget() returns NULL.

Replace with !ISERRORNULL(cpuclk) which only proceeds for valid pointers, preventing potential NULL pointer dereference in clkgetrate().

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40346.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
b8fe128dad8f97cc9af7c55a264d1fc5ab677195
Fixed
64da320252e43456cc9ec3055ff567f168467b37
Fixed
02fbea0864fd4a863671f5d418129258d7159f68
Fixed
a77f8434954cb1e9c42c3854e40855fdcf5ab235
Fixed
3373f263bb647fcc3b5237cfaef757633b9ee25e
Fixed
45379303124487db3a81219af7565d41f498167f
Fixed
3a01b2614e84361aa222f67bc628593987e5cdb2
Fixed
2eead19334516c8e9927c11b448fbe512b1f18a1

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40346.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.7.0
Fixed
5.10.246
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.196
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.158
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.115
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.56
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.6

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40346.json"