net: ethernet: mtk_eth_soc: unregister net_devices in case of probe failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: ethernet: mtk_eth_soc: unregister net_devices in case of probe failure
If register_netdev() fails for one of the MTK_MAX_DEVS devices in mtk_probe(), the error path jumps to err_deinit_ppe, skipping mtk_unreg_dev(). The previously registered net_devices are then freed by mtk_free_dev() while still in NETREG_REGISTERED state, hitting the BUG_ON(dev->reg_state != NETREG_UNREGISTERED).
Route the register_netdev() failure to err_unreg_netdev so the net_devices registered so far are properly unregistered before being freed.
From the CVE record · Linux
The Linux kernel’s mtk_eth_soc driver can hit a kernel BUG if registration of a network device fails during probe. Previously registered devices are freed without being unregistered; the input does not describe an attacker path or access requirements.
Engineers running Linux kernels that include the mtk_eth_soc Ethernet driver should check their kernel version; affected versions are not specified.