# CVE-2025-40346: arch\_topology: Fix incorrect error check in topology\_parse\_cpu\_capacity()

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-12-16T13:30:20.395Z
- **Modified:** 2026-10-14T13:10:00.187Z

## Who should check

- Anyone running Linux \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 64da320252e43456cc9ec3055ff567f168467b37; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 02fbea0864fd4a863671f5d418129258d7159f68; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< a77f8434954cb1e9c42c3854e40855fdcf5ab235; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 3373f263bb647fcc3b5237cfaef757633b9ee25e; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 45379303124487db3a81219af7565d41f498167f; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 3a01b2614e84361aa222f67bc628593987e5cdb2; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 2eead19334516c8e9927c11b448fbe512b1f18a1
- Anyone running Linux 5.7

## Description

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

arch\_topology: Fix incorrect error check in topology\_parse\_cpu\_capacity()

Fix incorrect use of PTR\_ERR\_OR\_ZERO() in topology\_parse\_cpu\_capacity()
which causes the code to proceed with NULL clock pointers. The current
logic uses !PTR\_ERR\_OR\_ZERO(cpu\_clk) which evaluates to true for both
valid pointers and NULL, leading to potential NULL pointer dereference
in clk\_get\_rate().

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

This means PTR\_ERR\_OR\_ZERO() returns 0 for both valid pointers AND NULL
pointers. Therefore !PTR\_ERR\_OR\_ZERO(cpu\_clk) evaluates to true (proceed)
when cpu\_clk is either valid or NULL, causing clk\_get\_rate(NULL) to be
called when of\_clk\_get() returns NULL.

Replace with !IS\_ERR\_OR\_NULL(cpu\_clk) which only proceeds for valid
pointers, preventing potential NULL pointer dereference in clk\_get\_rate().

## Affected and fixed versions

- Linux: \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 64da320252e43456cc9ec3055ff567f168467b37; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 02fbea0864fd4a863671f5d418129258d7159f68; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< a77f8434954cb1e9c42c3854e40855fdcf5ab235; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 3373f263bb647fcc3b5237cfaef757633b9ee25e; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 45379303124487db3a81219af7565d41f498167f; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 3a01b2614e84361aa222f67bc628593987e5cdb2; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 2eead19334516c8e9927c11b448fbe512b1f18a1 (cvelist)
- Linux: 5.7 (cvelist)

## Mitigation

- Upgrade Linux to 2eead19334516c8e9927c11b448fbe512b1f18a1 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-40346.md
Affected: Linux >= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, < 64da320252e43456cc9ec3055ff567f168467b37; >= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, < 02fbea0864fd4a863671f5d418129258d7159f68; >= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, < a77f8434954cb1e9c42c3854e40855fdcf5ab235; >= b8fe128dad8f97cc9af7c55…
Fixed in: Linux 64da320252e43456cc9ec3055ff567f168467b37, Linux 02fbea0864fd4a863671f5d418129258d7159f68, Linux 3373f263bb647fcc3b5237cfaef757633b9ee25e, Linux 45379303124487db3a81219af7565d41f498167f, Linux 3a01b2614e84361aa222f67bc628593987e5cdb2, Linux 2eead19334516c8e9927c11b448fbe512b1f18a1

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-40346 being exploited?

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 64da320252e43456cc9ec3055ff567f168467b37; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 02fbea0864fd4a863671f5d418129258d7159f68; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< a77f8434954cb1e9c42c3854e40855fdcf5ab235; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 3373f263bb647fcc3b5237cfaef757633b9ee25e; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 45379303124487db3a81219af7565d41f498167f; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 3a01b2614e84361aa222f67bc628593987e5cdb2; \>= b8fe128dad8f97cc9af7c55a264d1fc5ab677195, \< 2eead19334516c8e9927c11b448fbe512b1f18a1; Linux 5.7.

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

Yes. Fixed in Linux 64da320252e43456cc9ec3055ff567f168467b37, Linux 02fbea0864fd4a863671f5d418129258d7159f68, Linux 3373f263bb647fcc3b5237cfaef757633b9ee25e, Linux 45379303124487db3a81219af7565d41f498167f, Linux 3a01b2614e84361aa222f67bc628593987e5cdb2, Linux 2eead19334516c8e9927c11b448fbe512b1f18a1. Upgrade Linux to 2eead19334516c8e9927c11b448fbe512b1f18a1 or later.

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

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

- other: <https://git.kernel.org/stable/c/64da320252e43456cc9ec3055ff567f168467b37>
- other: <https://git.kernel.org/stable/c/02fbea0864fd4a863671f5d418129258d7159f68>
- other: <https://git.kernel.org/stable/c/a77f8434954cb1e9c42c3854e40855fdcf5ab235>
- other: <https://git.kernel.org/stable/c/3373f263bb647fcc3b5237cfaef757633b9ee25e>
- other: <https://git.kernel.org/stable/c/45379303124487db3a81219af7565d41f498167f>
- other: <https://git.kernel.org/stable/c/3a01b2614e84361aa222f67bc628593987e5cdb2>
- other: <https://git.kernel.org/stable/c/2eead19334516c8e9927c11b448fbe512b1f18a1>

## 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-40346>

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