net: dsa: mv88e6xxx: avoid unregistering devlink regions which were never registered
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 836021a2d0e0e4c90b895a35bd9c0342071855fb · < c84f6ce918a9e6f4996597cbc62536bbf2247c96| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: dsa: mv88e6xxx: avoid unregistering devlink regions which were never registered
Russell King reports that a system with mv88e6xxx dereferences a NULL pointer when unbinding this driver: https://lore.kernel.org/netdev/Z_lRkMlTJ1KQ0kVX@shell.armlinux.org.uk/
The crash seems to be in devlink_region_destroy(), which is not NULL tolerant but is given a NULL devlink global region pointer.
At least on some chips, some devlink regions are conditionally registered since the blamed commit, see mv88e6xxx_setup_devlink_regions_global():
if (cond && !cond(chip)) continue;
These are MV88E6XXX_REGION_STU and MV88E6XXX_REGION_PVT. If the chip does not have an STU or PVT, it should crash like this.
To fix the issue, avoid unregistering those regions which are NULL, i.e. were skipped at mv88e6xxx_setup_devlink_regions_global() time.
From the CVE record · Linux
The Linux kernel’s mv88e6xxx driver can dereference a NULL pointer when it is unbound on a chip without an STU or PVT devlink region, causing a crash. The input does not establish an attacker path, authentication requirement, or user-interaction requirement.
Engineers running Linux systems that use the mv88e6xxx driver should check their kernel; affected versions are not specified.