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().
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40346.json"
}