CVE-2025-38313 bus: fsl-mc: fix double-free on mc_dev

High 7.8 Published Updated

A double-free vulnerability in the Linux kernel's fsl-mc bus driver allows attackers to cause a denial of service or potentially execute arbitrary code.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38313?

CVE-2025-38313 is a high-severity use after free vulnerability in Debian Debian Linux, published on 10 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

bus: fsl-mc: fix double-free on mc_dev

The blamed commit tried to simplify how the deallocations are done but, in the process, introduced a double-free on the mc_dev variable.

In case the MC device is a DPRC, a new mc_bus is allocated and the mc_dev variable is just a reference to one of its fields. In this circumstance, on the error path only the mc_bus 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 (mc_bus) + kfree(mc_bus);

Weakness: CWE-415

Which versions are affected by CVE-2025-38313?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38313?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-38313 being exploited?

There is no known exploitation of CVE-2025-38313 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-65024, BELL-CVE-2025-38313, DEBIAN-CVE-2025-38313, GHSA-g943-c7gq-998h, ROOT-OS-DEBIAN-11-CVE-2025-38313, ROOT-OS-DEBIAN-12-CVE-2025-38313 and 3 more.

Is CVE-2025-38313 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free