{"id":"CVE-2025-21738","summary":"ata: libata-sff: Ensure that we cannot write outside the allocated buffer","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nata: libata-sff: Ensure that we cannot write outside the allocated buffer\n\nreveliofuzzing reported that a SCSI_IOCTL_SEND_COMMAND ioctl with out_len\nset to 0xd42, SCSI command set to ATA_16 PASS-THROUGH, ATA command set to\nATA_NOP, and protocol set to ATA_PROT_PIO, can cause ata_pio_sector() to\nwrite outside the allocated buffer, overwriting random memory.\n\nWhile a ATA device is supposed to abort a ATA_NOP command, there does seem\nto be a bug either in libata-sff or QEMU, where either this status is not\nset, or the status is cleared before read by ata_sff_hsm_move().\nAnyway, that is most likely a separate bug.\n\nLooking at __atapi_pio_bytes(), it already has a safety check to ensure\nthat __atapi_pio_bytes() cannot write outside the allocated buffer.\n\nAdd a similar check to ata_pio_sector(), such that also ata_pio_sector()\ncannot write outside the allocated buffer.","modified":"2026-03-31T17:29:43.683449Z","published":"2025-02-27T02:12:13.942Z","related":["ALSA-2025:20095","ALSA-2025:20518","SUSE-SU-2025:01919-1","SUSE-SU-2025:1177-1","SUSE-SU-2025:1178-1","SUSE-SU-2025:1180-1","SUSE-SU-2025:20190-1","SUSE-SU-2025:20192-1","SUSE-SU-2025:20260-1","SUSE-SU-2025:20270-1","SUSE-SU-2026:0617-1","SUSE-SU-2026:0928-1","SUSE-SU-2026:0953-1","SUSE-SU-2026:0954-1","SUSE-SU-2026:0958-1","SUSE-SU-2026:0961-1","SUSE-SU-2026:0964-1","SUSE-SU-2026:0967-1","SUSE-SU-2026:0970-1","SUSE-SU-2026:0983-1","SUSE-SU-2026:0984-1","SUSE-SU-2026:0985-1","SUSE-SU-2026:0992-1","SUSE-SU-2026:0997-1","SUSE-SU-2026:1000-1","SUSE-SU-2026:1002-1","SUSE-SU-2026:1003-1","SUSE-SU-2026:1039-1","SUSE-SU-2026:1044-1","SUSE-SU-2026:1045-1","SUSE-SU-2026:1046-1","SUSE-SU-2026:1048-1","SUSE-SU-2026:1049-1","SUSE-SU-2026:1059-1","SUSE-SU-2026:1060-1","SUSE-SU-2026:1077-1","SUSE-SU-2026:1078-1","SUSE-SU-2026:1088-1","SUSE-SU-2026:1130-1","SUSE-SU-2026:1131-1","SUSE-SU-2026:20847-1","SUSE-SU-2026:20857-1","SUSE-SU-2026:20880-1","SUSE-SU-2026:20891-1","USN-7521-2"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21738.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/0a17a9944b8d89ef03946121241870ac53ddaf45"},{"type":"WEB","url":"https://git.kernel.org/stable/c/0dd5aade301a10f4b329fa7454fdcc2518741902"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6e74e53b34b6dec5a50e1404e2680852ec6768d2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d5e6e3000309359eae2a17117aa6e3c44897bf6c"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21738.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21738"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"5a5dbd18a7496ed403f6f54bb20c955c65482fa5"},{"fixed":"a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c"},{"fixed":"d5e6e3000309359eae2a17117aa6e3c44897bf6c"},{"fixed":"0dd5aade301a10f4b329fa7454fdcc2518741902"},{"fixed":"0a17a9944b8d89ef03946121241870ac53ddaf45"},{"fixed":"6e74e53b34b6dec5a50e1404e2680852ec6768d2"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-21738.json"}}],"schema_version":"1.7.5"}