CVE-2022-48961: net: mdio: fix unbalanced fwnode reference count in mdio_device_release()
In the Linux kernel, the following vulnerability has been resolved:
net: mdio: fix unbalanced fwnode reference count in mdiodevicerelease()
There is warning report about ofnode refcount leak while probing mdio device:
OF: ERROR: memory leak, expected refcount 1 instead of 2, ofnodeget()/ofnodeput() unbalanced - destroy cset entry: attach overlay node /spi/soc@0/mdio@710700c0/ethernet@4
In ofmdiobusregisterdevice(), we increase fwnode refcount by fwnodehandleget() before associating the ofnode with mdio device, but it has never been decreased in normal path. Since that, in mdiodevicerelease(), it needs to call fwnodehandleput() in addition instead of calling kfree() directly.
After above, just calling mdiodevicefree() in the error handle path of ofmdiobusregisterdevice() is enough to keep the refcount balanced.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2022-48961?
CVE-2022-48961 has been flagged for its potential to cause a memory refcount leak within the Linux kernel.
How do I fix CVE-2022-48961?
To fix CVE-2022-48961, update your Linux kernel to a version that has patched this vulnerability.
Which versions of the Linux kernel are affected by CVE-2022-48961?
CVE-2022-48961 affects Linux kernel versions from 4.5 up to 5.15.83, and versions from 5.16 up to 6.1-rc8.
What are the potential risks associated with CVE-2022-48961?
The risks of CVE-2022-48961 include potential system instability and crashes due to memory management issues.
Is CVE-2022-48961 likely to be exploited in the wild?
While CVE-2022-48961 is a serious vulnerability, its exploitability would depend on specific configurations and exposure of the affected systems.