CVE-2022-48812: net: dsa: lantiq_gswip: don't use devres for mdiobus
In the Linux kernel, the following vulnerability has been resolved:
net: dsa: lantiq_gswip: 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 GSWIP switch 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 GSWIP 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 gswip 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.
Security readout for executives and security teams
Plain-English summary
CVE-2022-48812 is a Linux kernel stability flaw in the Lantiq GSWIP network switch driver. Under specific shutdown/unbind conditions, the kernel can panic because an MDIO bus is freed while still registered. This appears most relevant to systems using this driver, often embedded or networking-oriented Linux devices.
Executive priority
Treat as a targeted reliability issue, not a broad emergency. Prioritize patch verification for embedded network devices or appliances using affected Linux kernels and Lantiq GSWIP hardware. Routine kernel update processes should address it where vendor fixes are available.
Technical view
The issue is in net/dsa/lantiq_gswip. devm_mdiobus_alloc used devres-managed cleanup, but devres_release_all can call devm_mdiobus_free before the bus is unregistered, causing mdiobus_free to panic. The stable fix changes allocation to non-devres handling and adds explicit free paths for orderly removal.
Likely exposure
Exposure is limited to Linux systems with the Lantiq GSWIP DSA switch driver in affected kernel builds. The CVE record references Linux 5.9-era introduction and stable fixes across maintained branches. Confirm against your exact vendor kernel, configuration, and backports.
Exploitation context
No active exploitation is indicated by KEV, and the provided sources do not describe remote exploitation. The described impact is a kernel panic during shutdown or driver unbind paths involving device links and certain bus behavior.
Researcher notes
Evidence is limited to kernel CVE metadata and stable patch references. No CVSS, CWE, or exploit details are provided. Analysis should focus on affected driver presence, branch-specific backports, and whether shutdown/unbind paths can trigger the panic in the deployed platform.
Mitigation direction
Update to a vendor kernel containing the referenced stable fixes.
For custom kernels, confirm the lantiq_gswip fix commit is backported.
Prioritize devices using Lantiq GSWIP or Linux DSA switch drivers.
If patch status is unclear, request guidance from the device or OS vendor.
Validation and detection
Inventory Linux kernels and embedded devices using Lantiq GSWIP.
Check kernel source or changelog for the referenced stable commits.
Verify CONFIG_NET_DSA and the lantiq_gswip driver are present where relevant.
Review crash logs for shutdown-time mdiobus_free or DSA driver panics.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2022-48812 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.