CVE-2025-22023

In the Linux kernel, the following vulnerability has been resolved: usb: xhci: Don't skip on Stopped - Length Invalid Up until commit d56b0b2ab142 ("usb: xhci: ensure skipped isoc TDs are returned when isoc ring is stopped") in v6.11, the driver didn't skip missed isochronous TDs when handling Stoppend and Stopped - Length Invalid events. Instead, it erroneously cleared the skip flag, which would cause the ring to get stuck, as future events won't match the missed TD which is never removed from the queue until it's cancelled. This buggy logic seems to have been in place substantially unchanged since the 3.x series over 10 years ago, which probably speaks first and foremost about relative rarity of this case in normal usage, but by the spec I see no reason why it shouldn't be possible. After d56b0b2ab142, TDs are immediately skipped when handling those Stopped events. This poses a potential problem in case of Stopped - Length Invalid, which occurs either on completed TDs (likely already given back) or Link and No-Op TRBs. Such event won't be recognized as matching any TD (unless it's the rare Link TRB inside a TD) and will result in skipping all pending TDs, giving them back possibly before they are done, risking isoc data loss and maybe UAF by HW. As a compromise, don't skip and don't clear the skip flag on this kind of event. Then the next event will skip missed TDs. A downside of not handling Stopped - Length Invalid on a Link inside a TD is that if the TD is cancelled, its actual length will not be updated to account for TRBs (silently) completed before the TD was stopped. I had no luck producing this sequence of completion events so there is no compelling demonstration of any resulting disaster. It may be a very rare, obscure condition. The sole motivation for this patch is that if such unlikely event does occur, I'd rather risk reporting a cancelled partially done isoc frame as empty than gamble with UAF. This will be fixed more properly by looking at Stopped event's TRB pointer when making skipping decisions, but such rework is unlikely to be backported to v6.12, which will stay around for a few years.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:*:*:*:*:*:*:*

History

28 Oct 2025, 18:53

Type Values Removed Values Added
CWE CWE-416
First Time Linux linux Kernel
Linux
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:*:*:*:*:*:*:*
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.8
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: usb: xhci: Don't skip on Stopped - Length Invalid Hasta el commit d56b0b2ab142 ("usb: xhci: ensure skipped isoc TDs are returns when is stopped ring") en v6.11, el controlador no omitía los TD isócronos omitidos al gestionar los eventos Stoppend y Stopped - Length Invalid. En su lugar, borraba erróneamente el indicador de omisión, lo que provocaría que el anillo se atascara, ya que los eventos futuros no coincidirán con el TD omitido, que nunca se elimina de la cola hasta que se cancela. Esta lógica defectuosa parece haber estado en su lugar sustancialmente sin cambios desde la serie 3.x hace más de 10 años, lo que probablemente habla en primer lugar sobre la relativa rareza de este caso en el uso normal, pero por la especificación no veo razón por la que no debería ser posible. Después de d56b0b2ab142, los TD se omiten inmediatamente al gestionar los eventos "Detenidos". Esto plantea un problema potencial en caso de "Detenido - Longitud Inválida", que ocurre en TD completados (probablemente ya devueltos) o en TRB de Enlace y No-Op. Este evento no se reconocerá como coincidente con ningún TD (a menos que se trate del inusual TRB de Enlace dentro de un TD) y provocará la omisión de todos los TD pendientes, devolviéndolos posiblemente antes de que finalicen, con el riesgo de pérdida de datos de isoc y posiblemente un fallo de hardware no operativo (UAF). Como solución intermedia, no omita ni borre el indicador de omisión en este tipo de evento. De este modo, el siguiente evento omitirá los TD omitidos. Una desventaja de no gestionar "Detenido - Longitud Inválida" en un Enlace dentro de un TD es que, si el TD se cancela, su longitud real no se actualizará para tener en cuenta los TRB completados (silenciosamente) antes de que se detuviera el TD. No tuve éxito en generar esta secuencia de eventos de finalización, por lo que no hay una demostración convincente de ningún desastre resultante. Puede ser una condición muy rara y desconocida. La única motivación para este parche es que, si ocurre un evento tan improbable, prefiero arriesgarme a reportar un marco isoc cancelado parcialmente completado como vacío que arriesgarme con UAF. Esto se solucionará mejor analizando el puntero TRB del evento detenido al tomar decisiones de omisión, pero es poco probable que esta modificación se incorpore a la versión 6.12, que se mantendrá vigente durante algunos años.
References () https://git.kernel.org/stable/c/49cf6f5293aeb706dd672608478336a003f37df6 - () https://git.kernel.org/stable/c/49cf6f5293aeb706dd672608478336a003f37df6 - Patch
References () https://git.kernel.org/stable/c/58d0a3fab5f4fdc112c16a4c6d382f62097afd1c - () https://git.kernel.org/stable/c/58d0a3fab5f4fdc112c16a4c6d382f62097afd1c - Patch
References () https://git.kernel.org/stable/c/6af20ac254cbd0e1178a3542767c9308e209eee5 - () https://git.kernel.org/stable/c/6af20ac254cbd0e1178a3542767c9308e209eee5 - Patch
References () https://git.kernel.org/stable/c/de9e78167f760a699806793d7c987239e4f6c8c3 - () https://git.kernel.org/stable/c/de9e78167f760a699806793d7c987239e4f6c8c3 - Patch

16 Apr 2025, 11:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-04-16 11:15

Updated : 2025-10-28 18:53


NVD link : CVE-2025-22023

Mitre link : CVE-2025-22023

CVE.ORG link : CVE-2025-22023


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-416

Use After Free