# CVE-2025-21738: ata: libata-sff: Ensure that we cannot write outside the allocated buffer

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2025-02-27T02:12:13.942Z
- Modified: 2026-10-15T02:17:31.647Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

ata: libata-sff: Ensure that we cannot write outside the allocated buffer

reveliofuzzing reported that a SCSI_IOCTL_SEND_COMMAND ioctl with out_len
set to 0xd42, SCSI command set to ATA_16 PASS-THROUGH, ATA command set to
ATA_NOP, and protocol set to ATA_PROT_PIO, can cause ata_pio_sector() to
write outside the allocated buffer, overwriting random memory.

While a ATA device is supposed to abort a ATA_NOP command, there does seem
to be a bug either in libata-sff or QEMU, where either this status is not
set, or the status is cleared before read by ata_sff_hsm_move().
Anyway, that is most likely a separate bug.

Looking at __atapi_pio_bytes(), it already has a safety check to ensure
that __atapi_pio_bytes() cannot write outside the allocated buffer.

Add a similar check to ata_pio_sector(), such that also ata_pio_sector()
cannot write outside the allocated buffer.

(As written by CVE List.)

## Affected

- Linux Linux: from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 before a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c; from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 before d5e6e3000309359eae2a17117aa6e3c44897bf6c; from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 before 0dd5aade301a10f4b329fa7454fdcc2518741902; from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 before 0a17a9944b8d89ef03946121241870ac53ddaf45; from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 before 6e74e53b34b6dec5a50e1404e2680852ec6768d2; 2.6.22 (not affected: before 2.6.22; from 6.1.129 up to 6.1.*; from 6.6.78 up to 6.6.*; from 6.12.14 up to 6.12.*; from 6.13.3 up to 6.13.*; from 6.14 up to *)
- linux linux_kernel: before 6.1.129; from 6.2 before 6.6.78; from 6.7 before 6.12.14; from 6.13 before 6.13.3

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c> (patch)
- <https://git.kernel.org/stable/c/d5e6e3000309359eae2a17117aa6e3c44897bf6c> (patch)
- <https://git.kernel.org/stable/c/0dd5aade301a10f4b329fa7454fdcc2518741902> (patch)
- <https://git.kernel.org/stable/c/0a17a9944b8d89ef03946121241870ac53ddaf45> (patch)
- <https://git.kernel.org/stable/c/6e74e53b34b6dec5a50e1404e2680852ec6768d2> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-784472.html>

## Sources

- CVE List: [CVE-2025-21738](https://www.cve.org/CVERecord?id=CVE-2025-21738), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2025-21738](https://nvd.nist.gov/vuln/detail/CVE-2025-21738), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2025-21738 · Whole record: https://cve.day/CVE-2025-21738.json · Rebuilt by cve.day 2026-11-25T22:58:54.515Z
