CVE-2026-23355

In the Linux kernel, the following vulnerability has been resolved: ata: libata: cancel pending work after clearing deferred_qc Syzbot reported a WARN_ON() in ata_scsi_deferred_qc_work(), caused by ap->ops->qc_defer() returning non-zero before issuing the deferred qc. ata_scsi_schedule_deferred_qc() is called during each command completion. This function will check if there is a deferred QC, and if ap->ops->qc_defer() returns zero, meaning that it is possible to queue the deferred qc at this time (without being deferred), then it will queue the work which will issue the deferred qc. Once the work get to run, which can potentially be a very long time after the work was scheduled, there is a WARN_ON() if ap->ops->qc_defer() returns non-zero. While we hold the ap->lock both when assigning and clearing deferred_qc, and the work itself holds the ap->lock, the code currently does not cancel the work after clearing the deferred qc. This means that the following scenario can happen: 1) One or several NCQ commands are queued. 2) A non-NCQ command is queued, gets stored in ap->deferred_qc. 3) Last NCQ command gets completed, work is queued to issue the deferred qc. 4) Timeout or error happens, ap->deferred_qc is cleared. The queued work is currently NOT canceled. 5) Port is reset. 6) One or several NCQ commands are queued. 7) A non-NCQ command is queued, gets stored in ap->deferred_qc. 8) Work is finally run. Yet at this time, there is still NCQ commands in flight. The work in 8) really belongs to the non-NCQ command in 2), not to the non-NCQ command in 7). The reason why the work is executed when it is not supposed to, is because it was never canceled when ap->deferred_qc was cleared in 4). Thus, ensure that we always cancel the work after clearing ap->deferred_qc. Another potential fix would have been to let ata_scsi_deferred_qc_work() do nothing if ap->ops->qc_defer() returns non-zero. However, canceling the work when clearing ap->deferred_qc seems slightly more logical, as we hold the ap->lock when clearing ap->deferred_qc, so we know that the work cannot be holding the lock. (The function could be waiting for the lock, but that is okay since it will do nothing if ap->deferred_qc is not set.)
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:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*

History

24 Apr 2026, 19:13

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ata: libata: cancelar trabajo pendiente después de limpiar deferred_qc Syzbot informó un WARN_ON() en ata_scsi_deferred_qc_work(), causado por ap->ops->qc_defer() que devolvía un valor distinto de cero antes de emitir el qc diferido. ata_scsi_schedule_deferred_qc() es llamada durante cada finalización de comando. Esta función verificará si hay un QC diferido, y si ap->ops->qc_defer() devuelve cero, lo que significa que es posible encolar el qc diferido en este momento (sin ser diferido), entonces encolará el trabajo que emitirá el qc diferido. Una vez que el trabajo se ejecuta, lo que potencialmente puede ser mucho tiempo después de que el trabajo fue programado, hay un WARN_ON() si ap->ops->qc_defer() devuelve un valor distinto de cero. Mientras mantenemos el ap->lock tanto al asignar como al limpiar deferred_qc, y el trabajo en sí mantiene el ap->lock, el código actualmente no cancela el trabajo después de limpiar el qc diferido. Esto significa que el siguiente escenario puede ocurrir: 1) Uno o varios comandos NCQ son encolados. 2) Un comando no-NCQ es encolado, se almacena en ap->deferred_qc. 3) El último comando NCQ se completa, el trabajo es encolado para emitir el qc diferido. 4) Ocurre un tiempo de espera o un error, ap->deferred_qc es limpiado. El trabajo encolado NO es cancelado actualmente. 5) El puerto es reiniciado. 6) Uno o varios comandos NCQ son encolados. 7) Un comando no-NCQ es encolado, se almacena en ap->deferred_qc. 8) El trabajo finalmente se ejecuta. Sin embargo, en este momento, todavía hay comandos NCQ en curso. El trabajo en 8) realmente pertenece al comando no-NCQ en 2), no al comando no-NCQ en 7). La razón por la cual el trabajo se ejecuta cuando no se supone que debe hacerlo, es porque nunca fue cancelado cuando ap->deferred_qc fue limpiado en 4). Por lo tanto, asegúrese de que siempre cancelemos el trabajo después de limpiar ap->deferred_qc. Otra solución potencial habría sido dejar que ata_scsi_deferred_qc_work() no hiciera nada si ap->ops->qc_defer() devuelve un valor distinto de cero. Sin embargo, cancelar el trabajo al limpiar ap->deferred_qc parece ligeramente más lógico, ya que mantenemos el ap->lock al limpiar ap->deferred_qc, por lo que sabemos que el trabajo no puede estar manteniendo el bloqueo. (La función podría estar esperando el bloqueo, pero eso está bien ya que no hará nada si ap->deferred_qc no está configurado.)
References () https://git.kernel.org/stable/c/0d12453818c35e1ded84633152c6b05002ae48b9 - () https://git.kernel.org/stable/c/0d12453818c35e1ded84633152c6b05002ae48b9 - Patch
References () https://git.kernel.org/stable/c/58e658763ba2aa9168d8516b98a6314d7461a53e - () https://git.kernel.org/stable/c/58e658763ba2aa9168d8516b98a6314d7461a53e - Patch
References () https://git.kernel.org/stable/c/6c5e8f16b5e8e614e829aaf38619bdd79107bb0a - () https://git.kernel.org/stable/c/6c5e8f16b5e8e614e829aaf38619bdd79107bb0a - Patch
References () https://git.kernel.org/stable/c/aac9b27f7c1f2b2cf7f50a9ca633ecbbcaf22af9 - () https://git.kernel.org/stable/c/aac9b27f7c1f2b2cf7f50a9ca633ecbbcaf22af9 - Patch
CWE NVD-CWE-noinfo
First Time Linux
Linux linux Kernel
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CPE cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

25 Mar 2026, 11:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-03-25 11:16

Updated : 2026-04-24 19:13


NVD link : CVE-2026-23355

Mitre link : CVE-2026-23355

CVE.ORG link : CVE-2026-23355


JSON object : View

Products Affected

linux

  • linux_kernel