5.5medium
usb: xhci: Fix memory leak in xhci_disable_slot()
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.12% (higher than 2% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: usb: xhci: Fix memory leak in xhci_disable_slot() xhci_alloc_command() allocates a command structure and, when the second argument is true, also allocates a completion structure. Currently, the error handling path in xhci_disable_slot() only frees the command structure using kfree(), causing the completion structure to leak. Use xhci_free_command() instead of kfree(). xhci_free_command() correctly frees both the command structure and the associated completion structure. Since the command structure is allocated with zero-initialization, command->in_ctx is NULL and will not be erroneously freed by xhci_free_command(). This bug was found using an experimental static analysis tool we are developing. The tool is based on the LLVM framework and is specifically designed to detect memory management issues. It is currently under active development and not yet publicly available, but we plan to open-source it after our research is published. The bug was originally detected on v6.13-rc1 using our static analysis tool, and we have verified that the issue persists in the latest mainline kernel. We performed build testing on x86_64 with allyesconfig using GCC=11.4.0. Since triggering these error paths in xhci_disable_slot() requires specific hardware conditions or abnormal state, we were unable to construct a test case to reliably trigger these specific error paths at runtime.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from fee8be5bde562d4f5f9a100ca80c6d7072ed34c8 before 1e800e26d54ccf2ddf2ea6d6cbe021c804d8aa62, from 02d5a2a48bb44e7404b794df87e57588b2fd604e before 6288baf0c8c4dcfbf206773aede9c1f2269cec28, from 7faac1953ed1f658f719cdf7bb7303fa5eef822c before 46aea90763832cd6e9b0c2e1c00e6a9512156d4b, from 7faac1953ed1f658f719cdf7bb7303fa5eef822c before 2e2baa8fb5aa4d080cbfeb84c51eff797529f413, from 7faac1953ed1f658f719cdf7bb7303fa5eef822c before 807e4fb5140c73eb5dba1e399a990db5c1f3cdf8, from 7faac1953ed1f658f719cdf7bb7303fa5eef822c before c65f1b840ab8ce72ba68f1b63bab7960f8fdfa89, from 7faac1953ed1f658f719cdf7bb7303fa5eef822c before 078b446efc0f5e496c31bccb72b98af979963a83, from 7faac1953ed1f658f719cdf7bb7303fa5eef822c before c1c8550e70401159184130a1afc6261db01fc0ce and 7 more Not affected: before 5.16, from 5.10.253 up to 5.10.*, from 5.15.203 up to 5.15.*, from 6.1.167 up to 6.1.*, from 6.6.130 up to 6.6.*, from 6.12.78 up to 6.12.* | CVE List |
| linux linux_kernel | from 4.19.221 before 4.20, from 5.4.165 before 5.5, from 5.10.85 before 5.10.253, from 5.15.8 before 5.15.203, from 5.16 before 6.1.167, from 6.2 before 6.6.130, from 6.7 before 6.12.78, from 6.13 before 6.18.19 and 2 more | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: usb: xhci: Fix memory leak in xhci_disable_slot() xhci_alloc_command() allocates a command structure and, when the second argument is true, also allocates a completion structure. Currently, the error handling path in xhci_disable_slot() only frees the command structure using kfree(), causing the completion structure to leak. Use xhci_free_command() instead of kfree(). xhci_free_command() correctly frees both the command structure and the associated completion structure. Since the command structure is allocated with zero-initialization, command->in_ctx is NULL and will not be erroneously freed by xhci_free_command(). This bug was found using an experimental static analysis tool we are developing. The tool is based on the LLVM framework and is specifically designed to detect memory management issues. It is currently under active development and not yet publicly available, but we plan to open-source it after our research is published. The bug was originally detected on v6.13-rc1 using our static analysis tool, and we have verified that the issue persists in the latest mainline kernel. We performed build testing on x86_64 with allyesconfig using GCC=11.4.0. Since triggering these error paths in xhci_disable_slot() requires specific hardware conditions or abnormal state, we were unable to construct a test case to reliably trigger these specific error paths at runtime.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: usb: xhci: Corrección de fuga de memoria en xhci_disable_slot() xhci_alloc_command() asigna una estructura de comando y, cuando el segundo argumento es verdadero, también asigna una estructura de completado. Actualmente, la ruta de manejo de errores en xhci_disable_slot() solo libera la estructura de comando usando kfree(), causando la fuga de la estructura de completado. Use xhci_free_command() en lugar de kfree(). xhci_free_command() libera correctamente tanto la estructura de comando como la estructura de completado asociada. Dado que la estructura de comando se asigna con inicialización a cero, command -> in_ctx es NULL y no será liberado erróneamente por xhci_free_command(). Este error fue encontrado usando una herramienta experimental de análisis estático que estamos desarrollando. La herramienta se basa en el framework LLVM y está específicamente diseñada para detectar problemas de gestión de memoria. Actualmente está en desarrollo activo y aún no está disponible públicamente, pero planeamos liberarlo como código abierto después de que se publique nuestra investigación. El error fue detectado originalmente en v6.13-rc1 usando nuestra herramienta de análisis estático, y hemos verificado que el problema persiste en el último kernel principal. Realizamos pruebas de compilación en x86_64 con allyesconfig usando GCC=11.4.0. Dado que activar estas rutas de error en xhci_disable_slot() requiere condiciones de hardware específicas o un estado anormal, no pudimos construir un caso de prueba para activar de forma fiable estas rutas de error específicas en tiempo de ejecución.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-43432 changed 2026-11-06 | CVE Terms of Use |
| NVD | CVE-2026-43432 changed 2026-11-11 | Public domain |