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 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 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 (mcbus) + kfree(mcbus);
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38313.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38313.json"
[
{
"id": "CVE-2025-38313-70e96fa0",
"digest": {
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@873d47114fd5e5a1cad2018843671537cc71ac84",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c"
}
},
{
"id": "CVE-2025-38313-ef94ced2",
"digest": {
"function_hash": "171999151616992981861295649021196121209",
"length": 1985.0
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@873d47114fd5e5a1cad2018843671537cc71ac84",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c",
"function": "fsl_mc_device_add"
}
}
]