Categories
CVE-2026-23355

ata: libata: cancel pending work after clearing deferred_qc

Summary

ata: libata: cancel pending work after clearing deferred_qc

Original description

The description as published by the source.

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…

Source: OSV.dev (Open Source Vulnerabilities) NVD OSV

Affected packages

Linux Kernel
[{"type":"ECOSYSTEM","events":[{"introduced":"6.18.14"},{"fixed":"6.18.18"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.4"},{"fixed":"6.19.7"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details