net: cpsw_new: Fix potential unregister of netdev that has not been registered yet
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ed3525eda4c4983fb8509e488de0a351788041ba · < 29739ec197ed66535bc0b86f14ab66c5f4512138| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: cpsw_new: Fix potential unregister of netdev that has not been registered yet
If an error occurs during register_netdev() for the first MAC in cpsw_register_ports(), even though cpsw->slaves[0].ndev is set to NULL, cpsw->slaves[1].ndev would remain unchanged. This could later cause cpsw_unregister_ports() to attempt unregistering the second MAC. To address this, add a check for ndev->reg_state before calling unregister_netdev(). With this change, setting cpsw->slaves[i].ndev to NULL becomes unnecessary and can be removed accordingly.
From the CVE record · Linux
An error while registering the first MAC in the Linux kernel's cpsw_new driver can lead to an attempt to unregister a second MAC that was not registered. The input does not describe an attacker action, access requirements, or user interaction.
Teams running Linux kernels with the cpsw_new driver should check their exposure; affected versions are not specified.