Descrizione
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: fix refcount underflow in gadgetfs_bind() error path gadgetfs_bind() calls get_dev() only on the success path, but gadgetfs_unbind() called from the enomem error label unconditionally calls put_dev(). When bind fails (e.g. ENOMEM), put_dev() fires without a matching get_dev(), leaving the refcount unbalanced. A subsequent close of the ep0 file descriptor calls dev_release() -> put_dev() which hits zero and frees the object; then gadgetfs_kill_sb() calls put_dev(the_device) again on the already-freed pointer, triggering a refcount underflow and use-after-free. Fix by calling get_dev() at the start of gadgetfs_bind(), before any error path that invokes gadgetfs_unbind(), so the reference is always balanced regardless of whether bind succeeds or fails.
Come correggere
Priorità: Bassa — correggere con la manutenzione ordinaria. Motivazione: EPSS 0.2% (percentile 11).
Versioni da aggiornare
- Linux Linux: vulnerabili le versioni precedenti alla
6.12.117→ aggiornare alla6.12.117o successiva. - Linux Linux: vulnerabili le versioni precedenti alla
6.18.61→ aggiornare alla6.18.61o successiva. - Linux Linux: vulnerabili le versioni precedenti alla
7.3.2→ aggiornare alla7.3.2o successiva. - Linux Linux: versione corretta
6.12.117(o successiva). - Linux Linux: versione corretta
6.18.61(o successiva). - Linux Linux: versione corretta
7.3.2(o successiva). - Linux Linux: versione corretta
7.4-rc1(o successiva).
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre l'esposizione del componente vulnerabile (segmentazione, accesso solo da reti fidate) finché la patch non è applicata.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| Linux | Linux | < 6.12.117 | 6.12.117 |
| Linux | Linux | < 6.18.61 | 6.18.61 |
| Linux | Linux | < 7.3.2 | 7.3.2 |
| Linux | Linux | — | 6.12.117 |
| Linux | Linux | — | 6.18.61 |
| Linux | Linux | — | 7.3.2 |
| Linux | Linux | — | 7.4-rc1 |
Riferimenti
- Riferimentohttps://git.kernel.org/stable/c/a28791bdb256abd0f338a9b32a95392907d1c987
- Riferimentohttps://git.kernel.org/stable/c/adb693d0369cd7f08f9424588fdd1f613c22d43b
- Riferimentohttps://git.kernel.org/stable/c/cb3b441f2698455a48e9a023d5f7f4e3fcb94c73
- Riferimentohttps://git.kernel.org/stable/c/e7e89759445e97ccb445758c6c8d5caed4eb42f9