В ядре Linux устранена следующая уязвимость:
net: ethtool: phy: избегать разыменования NULL, когда драйвер PHY не привязан
phydev->drv может стать NULL, пока phy_device все еще подключен к
его net_device, а именно после отвязки драйвера PHY через sysfs:
echo <mdio_id> > /sys/bus/mdio_bus/drivers/<phy_drv>/отменить привязку
phy_remove() очищает phydev->drv, но не вызывает phy_detach(), поэтому
phy_device остается в топологии ссылок xarray и ethnl_req_get_phydev()
все равно отдает обратно. ETHTOOL_MSG_PHY_GET затем выдает:
Rep_data->drvname = kstrdup(phydev->drv->name, GFP_KERNEL);
drvname уже рассматривается как необязательный с помощью phy_reply_size(),
phy_fill_reply() и phy_cleanup_data(), поэтому просто пропустите выделение
когда нет привязки драйвера.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net: ethtool: phy: avoid NULL deref when PHY driver is unbound phydev->drv can become NULL while the phy_device is still attached to its net_device, namely after the PHY driver is unbound via sysfs: echo <mdio_id> > /sys/bus/mdio_bus/drivers/<phy_drv>/unbind phy_remove() clears phydev->drv but doesn't call phy_detach(), so the phy_device stays in the link topology xarray and ethnl_req_get_phydev() still hands it back. ETHTOOL_MSG_PHY_GET then oopses on: rep_data->drvname = kstrdup(phydev->drv->name, GFP_KERNEL); drvname is already treated as optional by phy_reply_size(), phy_fill_reply() and phy_cleanup_data(), so just skip the allocation when there is no driver bound.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.16
|
6.18.34
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.0.11
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc3:*:*:*:*:*:*
|
— | — |