7.8high
spi: spi-sprd-adi: Fix double free in probe error path
- Severity
- 7.8high CVSS:3.1 by NVD
- Exploit likelihood
- 0.15% (higher than 4% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: spi: spi-sprd-adi: Fix double free in probe error path The driver currently uses spi_alloc_host() to allocate the controller but registers it using devm_spi_register_controller(). If devm_register_restart_handler() fails, the code jumps to the put_ctlr label and calls spi_controller_put(). However, since the controller was registered via a devm function, the device core will automatically call spi_controller_put() again when the probe fails. This results in a double-free of the spi_controller structure. Fix this by switching to devm_spi_alloc_host() and removing the manual spi_controller_put() call.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from ac1775012058e13ef1522938e27f5973d9e3f053 before bddd3d10d039729b81cfb0804520c8832a701a0e, from ac1775012058e13ef1522938e27f5973d9e3f053 before 417cdfd9b9f986e95bfcb1d68eb443e6e0a15f8c, from ac1775012058e13ef1522938e27f5973d9e3f053 before 346775f2b4cf839177e8e86b94aa180a06dc15b0, from ac1775012058e13ef1522938e27f5973d9e3f053 before f6d6b3f172df118db582fe5ec43ae223a55d99cf, from ac1775012058e13ef1522938e27f5973d9e3f053 before 383d4f5cffcc8df930d95b06518a9d25a6d74aac, 4.17 Not affected: before 4.17, from 6.1.162 up to 6.1.*, from 6.6.122 up to 6.6.*, from 6.12.68 up to 6.12.*, from 6.18.8 up to 6.18.*, from 6.19 up to * | CVE List |
| linux linux_kernel | from 4.17 before 6.1.162, from 6.2 before 6.6.122, from 6.7 before 6.12.68, from 6.13 before 6.18.8, 6.19 | NVD |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: spi: spi-sprd-adi: Fix double free in probe error path The driver currently uses spi_alloc_host() to allocate the controller but registers it using devm_spi_register_controller(). If devm_register_restart_handler() fails, the code jumps to the put_ctlr label and calls spi_controller_put(). However, since the controller was registered via a devm function, the device core will automatically call spi_controller_put() again when the probe fails. This results in a double-free of the spi_controller structure. Fix this by switching to devm_spi_alloc_host() and removing the manual spi_controller_put() call.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: spi: spi-sprd-adi: Corregir doble liberación en la ruta de error de sondeo El controlador actualmente usa spi_alloc_host() para asignar el controlador pero lo registra usando devm_spi_register_controller(). Si devm_register_restart_handler() falla, el código salta a la etiqueta put_ctlr y llama a spi_controller_put(). Sin embargo, dado que el controlador fue registrado a través de una función devm, el núcleo del dispositivo llamará automáticamente a spi_controller_put() de nuevo cuando el sondeo falle. Esto resulta en una doble liberación de la estructura spi_controller. Corregir esto cambiando a devm_spi_alloc_host() y eliminando la llamada manual a spi_controller_put().
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23068 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2026-23068 changed 2026-06-17 | Public domain |