bus: fsl-mc: fix double-free on mc_dev
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a042fbed02904493ae6df26ec836045f5a7d3ce2 · < 1d5baab39e5b09a76870b345cdee7933871b881f| No fix yet |
| Linux Linux |
|
|
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);
From the CVE record · Linux
The Linux kernel’s fsl-mc bus code can double-free mc_dev on an error path when the MC device is a DPRC. The input does not specify how an attacker could trigger the error path or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the fsl-mc bus code should check their kernel version; affected versions are not specified.