CVE-2022-48815
Last modified
CVE-2022-48815 is a medium-severity vulnerability rated 5.5/10 on the CVSS scale. In the Linux kernel, the following vulnerability has been resolved: net: dsa: bcm_sf2: don't use devres for mdiobus As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The Starfighter 2 is a platform device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the bcm_sf2 switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The bcm_sf2 driver has the code structure in place for orderly mdiobus removal, so just replace devm_mdiobus_alloc() with the non-devres variant, and add manual free where necessary, to ensure that we don't let devres free a still-registered bus.. EPSS estimates a 0.27% chance of exploitation in the next 30 days.
Description
In the Linux kernel, the following vulnerability has been resolved: net: dsa: bcm_sf2: don't use devres for mdiobus As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The Starfighter 2 is a platform device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the bcm_sf2 switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The bcm_sf2 driver has the code structure in place for orderly mdiobus removal, so just replace devm_mdiobus_alloc() with the non-devres variant, and add manual free where necessary, to ensure that we don't let devres free a still-registered bus.
Metrics
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Affected Software
| Vendor | Product | Versions | Update |
|---|---|---|---|
| Linux | Linux Kernel | >= 5.9, < 5.10.101 | — |
| Linux | Linux Kernel | >= 5.11, < 5.15.24 | — |
| Linux | Linux Kernel | >= 5.16, < 5.16.10 | — |
| Linux | Linux Kernel | 5.17 | Rc1 |
References
Timeline
- Published
- Last Modified
- Status
- Analyzed
Frequently Asked Questions
What is CVE-2022-48815?
How severe is CVE-2022-48815?
How do I fix CVE-2022-48815?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2022
- CVE-2022-4881A vulnerability was found in CapsAdmin PAC3. It has been rat…5.4
- CVE-2022-48810In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48811In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48812In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48813In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48814In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48816In the Linux kernel, the following vulnerability has been re…4.7
- CVE-2022-48817In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48818In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-48819In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2022-4882A vulnerability was found in kaltura mwEmbed up to 2.91. It …4.7
- CVE-2022-48820In the Linux kernel, the following vulnerability has been re…7.1
Are you affected by CVE-2022-48815?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
