CVE-2026-99587: ata: libata-scsi: reject data-in commands with a data-out buffer
In the Linux kernel, the following vulnerability has been resolved:
ata: libata-scsi: reject data-in commands with a data-out buffer
SGIO can submit a data-in SCSI command with DMATODEVICE. The scatterlist can then contain pages pinned without write access. atascsirbuffill() writes simulated replies to that scatterlist; in the reported case, the copy tried to write the shared zero page and faulted in the kernel.
The same mismatch can affect SGIO commands translated by libata. ZBC IN and GET PHYSICAL ELEMENT STATUS completion handlers can modify the receive buffer even if the drive aborts the command. For ATAPI, the successful INQUIRY completion also rewrites the buffer in atapifixupinquiry().
Reject these mismatched commands before the buffer is written or the command is issued. Report ABORTED COMMAND / DATA IN BUFFER ERROR because the CDB itself can be valid; the supplied transfer direction is wrong.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1 - Compensating control
In libata-scsi, reject data-in SCSI commands submitted with DMA_TO_DEVICE or a data-out buffer before writing to the buffer, and report ABORTED COMMAND / DATA IN BUFFER ERROR.
Event History
Frequently Asked Questions
What access does an attacker need to trigger this issue?
An attacker needs the ability to submit SG_IO SCSI commands to a libata-managed device and supply a data-in command with a DMA_TO_DEVICE buffer. The issue arises when the kernel later writes a simulated or completion-handled response into pages that were pinned without write access.
Which command paths can write to the incorrectly supplied buffer?
The affected paths include simulated replies handled by ata_scsi_rbuf_fill(), libata-translated SG_IO commands involving ZBC IN or GET PHYSICAL ELEMENT STATUS, and ATAPI INQUIRY completion processing in atapi_fixup_inquiry(). ZBC IN and GET PHYSICAL ELEMENT STATUS may modify the receive buffer even when the drive aborts the command.
How does the fix handle malformed transfer directions?
The fix rejects data-in commands supplied with a data-out buffer before the command is issued or a response is written. It reports SCSI status ABORTED COMMAND / DATA IN BUFFER ERROR, because the command CDB can be valid while its supplied transfer direction is not.