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);
[
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d5baab39e5b09a76870b345cdee7933871b881f",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c"
},
"id": "CVE-2025-38313-1510b9db",
"signature_type": "Line"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3135e03a92f6b5259d0a7f25f728e9e7866ede3f",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c"
},
"id": "CVE-2025-38313-1a9567cb",
"signature_type": "Line"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@12e4431e5078847791936820bd39df9e1ee26d2e",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c"
},
"id": "CVE-2025-38313-4be0f578",
"signature_type": "Line"
},
{
"digest": {
"length": 1985.0,
"function_hash": "171999151616992981861295649021196121209"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3135e03a92f6b5259d0a7f25f728e9e7866ede3f",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c",
"function": "fsl_mc_device_add"
},
"id": "CVE-2025-38313-6071757e",
"signature_type": "Function"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
]
},
"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-70e96fa0",
"signature_type": "Line"
},
{
"digest": {
"length": 1950.0,
"function_hash": "123328502854484495199081264901816323833"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@12e4431e5078847791936820bd39df9e1ee26d2e",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c",
"function": "fsl_mc_device_add"
},
"id": "CVE-2025-38313-8bbe341a",
"signature_type": "Function"
},
{
"digest": {
"length": 1985.0,
"function_hash": "171999151616992981861295649021196121209"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d5baab39e5b09a76870b345cdee7933871b881f",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c",
"function": "fsl_mc_device_add"
},
"id": "CVE-2025-38313-94da9b61",
"signature_type": "Function"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4b23c46eb2d88924b93aca647bde9a4b9cf62cf9",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c"
},
"id": "CVE-2025-38313-b4389488",
"signature_type": "Line"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"66488835348429792727753419694636503552",
"203806641870491553677352997156798160782",
"268309192396422195506554340484565217670",
"259989628272387967716929952925049726523",
"226606119661479432249682446606905293134"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2057374f326303c86d8423415ab58656eebc695",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c"
},
"id": "CVE-2025-38313-c9176144",
"signature_type": "Line"
},
{
"digest": {
"length": 1985.0,
"function_hash": "171999151616992981861295649021196121209"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2057374f326303c86d8423415ab58656eebc695",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c",
"function": "fsl_mc_device_add"
},
"id": "CVE-2025-38313-d91f6a84",
"signature_type": "Function"
},
{
"digest": {
"length": 1985.0,
"function_hash": "171999151616992981861295649021196121209"
},
"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"
},
"id": "CVE-2025-38313-ef94ced2",
"signature_type": "Function"
},
{
"digest": {
"length": 1985.0,
"function_hash": "171999151616992981861295649021196121209"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4b23c46eb2d88924b93aca647bde9a4b9cf62cf9",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/bus/fsl-mc/fsl-mc-bus.c",
"function": "fsl_mc_device_add"
},
"id": "CVE-2025-38313-fcfea753",
"signature_type": "Function"
}
]