Security Vulnerability Report
中文
CVE-2026-23355 CVSS 5.5 MEDIUM

CVE-2026-23355

Published: 2026-03-25 11:16:34
Last Modified: 2026-04-24 19:13:44
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

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.)

CVSS Details

CVSS Score
5.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:* - VULNERABLE
Linux Kernel (特定版本,详见Git提交记录)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Conceptual PoC for CVE-2026-23355 // This requires a specific hardware setup and precise timing to trigger the race condition. #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <scsi/sg.h> #define DEVICE "/dev/sg0" // Example SCSI generic device int main() { int fd = open(DEVICE, O_RDWR); if (fd < 0) { perror("Failed to open device"); return 1; } printf("[+] Attempting to trigger race condition in libata...\n"); // Step 1: Send multiple NCQ commands (simulated) // Step 2: Send non-NCQ command to trigger deferred_qc // Step 3: Force timeout/error to clear deferred_qc without canceling work // Step 4: Reset port and send new commands // Step 5: Wait for old work to run and trigger WARN_ON // Note: Actual exploitation requires precise control over the ATA hardware layer. // This is a structural representation of the attack flow. for(int i = 0; i < 1000; i++) { // Simulated I/O operations write(fd, "data", 4); usleep(100); } close(fd); printf("[+] Done. Check dmesg for WARN_ON(ata_scsi_deferred_qc_work).\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23355", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2026-03-25T11:16:34.110", "lastModified": "2026-04-24T19:13:44.037", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nata: libata: cancel pending work after clearing deferred_qc\n\nSyzbot reported a WARN_ON() in ata_scsi_deferred_qc_work(), caused by\nap->ops->qc_defer() returning non-zero before issuing the deferred qc.\n\nata_scsi_schedule_deferred_qc() is called during each command completion.\nThis function will check if there is a deferred QC, and if\nap->ops->qc_defer() returns zero, meaning that it is possible to queue the\ndeferred qc at this time (without being deferred), then it will queue the\nwork which will issue the deferred qc.\n\nOnce the work get to run, which can potentially be a very long time after\nthe work was scheduled, there is a WARN_ON() if ap->ops->qc_defer() returns\nnon-zero.\n\nWhile we hold the ap->lock both when assigning and clearing deferred_qc,\nand the work itself holds the ap->lock, the code currently does not cancel\nthe work after clearing the deferred qc.\n\nThis means that the following scenario can happen:\n1) One or several NCQ commands are queued.\n2) A non-NCQ command is queued, gets stored in ap->deferred_qc.\n3) Last NCQ command gets completed, work is queued to issue the deferred\n qc.\n4) Timeout or error happens, ap->deferred_qc is cleared. The queued work is\n currently NOT canceled.\n5) Port is reset.\n6) One or several NCQ commands are queued.\n7) A non-NCQ command is queued, gets stored in ap->deferred_qc.\n8) Work is finally run. Yet at this time, there is still NCQ commands in\n flight.\n\nThe work in 8) really belongs to the non-NCQ command in 2), not to the\nnon-NCQ command in 7). The reason why the work is executed when it is not\nsupposed to, is because it was never canceled when ap->deferred_qc was\ncleared in 4). Thus, ensure that we always cancel the work after clearing\nap->deferred_qc.\n\nAnother potential fix would have been to let ata_scsi_deferred_qc_work() do\nnothing if ap->ops->qc_defer() returns non-zero. However, canceling the\nwork when clearing ap->deferred_qc seems slightly more logical, as we hold\nthe ap->lock when clearing ap->deferred_qc, so we know that the work cannot\nbe holding the lock. (The function could be waiting for the lock, but that\nis okay since it will do nothing if ap->deferred_qc is not set.)"}, {"lang": "es", "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nata: libata: cancelar trabajo pendiente después de limpiar deferred_qc\n\nSyzbot informó un WARN_ON() en ata_scsi_deferred_qc_work(), causado por ap-&gt;ops-&gt;qc_defer() que devolvía un valor distinto de cero antes de emitir el qc diferido.\n\nata_scsi_schedule_deferred_qc() es llamada durante cada finalización de comando. Esta función verificará si hay un QC diferido, y si ap-&gt;ops-&gt;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.\n\nUna 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-&gt;ops-&gt;qc_defer() devuelve un valor distinto de cero.\n\nMientras mantenemos el ap-&gt;lock tanto al asignar como al limpiar deferred_qc, y el trabajo en sí mantiene el ap-&gt;lock, el código actualmente no cancela el trabajo después de limpiar el qc diferido.\n\nEsto significa que el siguiente escenario puede ocurrir:\n1) Uno o varios comandos NCQ son encolados.\n2) Un comando no-NCQ es encolado, se almacena en ap-&gt;deferred_qc.\n3) El último comando NCQ se completa, el trabajo es encolado para emitir el qc diferido.\n4) Ocurre un tiempo de espera o un error, ap-&gt;deferred_qc es limpiado. El trabajo encolado NO es cancelado actualmente.\n5) El puerto es reiniciado.\n6) Uno o varios comandos NCQ son encolados.\n7) Un comando no-NCQ es encolado, se almacena en ap-&gt;deferred_qc.\n8) El trabajo finalmente se ejecuta. Sin embargo, en este momento, todavía hay comandos NCQ en curso.\n\nEl 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-&gt;deferred_qc fue limpiado en 4). Por lo tanto, asegúrese de que siempre cancelemos el trabajo después de limpiar ap-&gt;deferred_qc.\n\nOtra solución potencial habría sido dejar que ata_scsi_deferred_qc_work() no hiciera nada si ap-&gt;ops-&gt;qc_defer() devuelve un valor distinto de cero. Sin embargo, cancelar el trabajo al limpiar ap-&gt;deferred_qc parece ligeramente más lógico, ya que mantenemos el ap-&gt;lock al limpiar ap-&gt;deferred_qc, por lo que sabemos que el trabajo no puede estar manteniendo el bloqu ... (truncated)