CVE-2021-47416
phy: mdio: fix memory leak
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
In the Linux kernel, the following vulnerability has been resolved:
phy: mdio: fix memory leak
Syzbot reported memory leak in MDIO bus interface, the problem was in
wrong state logic.
MDIOBUS_ALLOCATED indicates 2 states:
1. Bus is only allocated
2. Bus allocated and __mdiobus_register() fails, but
device_register() was called
In case of device_register() has been called we should call put_device()
to correctly free the memory allocated for this device, but mdiobus_free()
calls just kfree(dev) in case of MDIOBUS_ALLOCATED state
To avoid this behaviour we need to set bus->state to MDIOBUS_UNREGISTERED
_before_ calling device_register(), because put_device() should be
called even in case of device_register() failure.
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: phy: mdio: arreglar pérdida de memoria. Syzbot informó una pérdida de memoria en la interfaz del bus MDIO, el problema estaba en una lógica de estado incorrecta. MDIOBUS_ALLOCATED indica 2 estados: 1. El bus solo está asignado 2. El bus asignado y __mdiobus_register() falla, pero se llamó a device_register() En caso de que se haya llamado a device_register() debemos llamar a put_device() para liberar correctamente la memoria asignada para esto dispositivo, pero mdiobus_free() llama solo a kfree(dev) en caso de estado MDIOBUS_ALLOCATED. Para evitar este comportamiento, necesitamos configurar bus->state en MDIOBUS_UNREGISTERED _antes_ de llamar a device_register(), porque put_device() debe llamarse incluso en caso de fallo de device_register( .
CVSS Scores
SSVC
- Decision:Track
Timeline
- 2024-05-21 CVE Reserved
- 2024-05-21 CVE Published
- 2024-05-22 EPSS Updated
- 2024-11-04 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
CAPEC
References (9)
URL | Tag | Source |
---|---|---|
https://git.kernel.org/stable/c/46abc02175b3c246dd5141d878f565a8725060c9 | Vuln. Introduced |
URL | Date | SRC |
---|
URL | Date | SRC |
---|
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 4.4.289 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 4.4.289" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 4.9.287 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 4.9.287" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 4.14.251 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 4.14.251" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 4.19.211 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 4.19.211" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 5.4.153 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 5.4.153" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 5.10.73 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 5.10.73" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 5.14.12 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 5.14.12" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.28 < 5.15 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.28 < 5.15" | en |
Affected
|