CVE-2025-38313: bus: fsl-mc: fix double-free on mc_dev
In the Linux kernel, the following vulnerability has been resolved:
bus: fsl-mc: fix double-free on mcdev
The blamed commit tried to simplify how the deallocations are done but, in the process, introduced a double-free on the mcdev variable.
In case the MC device is a DPRC, a new mcbus is allocated and the mcdev variable is just a reference to one of its fields. In this circumstance, on the error path only the mcbus should be freed.
This commit introduces back the following checkpatch warning which is a false-positive.
WARNING: kfree(NULL) is safe and this check is probably not required + if (mcbus) + kfree(mcbus);
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38313?
CVE-2025-38313 is considered a moderate severity vulnerability due to the potential for a double-free error in the Linux kernel.
How do I fix CVE-2025-38313?
To fix CVE-2025-38313, update your Linux kernel to a version that includes the patches addressing the double-free issue.
What systems are affected by CVE-2025-38313?
CVE-2025-38313 affects the Linux kernel, particularly systems utilizing the fsl-mc bus that manage MC devices.
What is a double-free vulnerability as seen in CVE-2025-38313?
A double-free vulnerability occurs when a program attempts to free the same memory address more than once, potentially leading to memory corruption.
Can CVE-2025-38313 be exploited by attackers?
Yes, CVE-2025-38313 could be exploited by attackers to execute arbitrary code or cause a denial of service on affected systems.