{"id":"CVE-2025-21738","aliases":["CVE-2025-21738"],"related":[],"kind":"vulnerability","state":"published","title":"ata: libata-sff: Ensure that we cannot write outside the allocated buffer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ata: libata-sff: Asegúrese de que no podamos escribir fuera del búfer asignado reveliofuzzing informó que un ioctl SCSI_IOCTL_SEND_COMMAND con out_len establecido en 0xd42, comando SCSI establecido en ATA_16 PASS-THROUGH, comando ATA establecido en ATA_NOP y protocolo establecido en ATA_PROT_PIO, puede hacer que ata_pio_sector() escriba fuera del búfer asignado, sobrescribiendo memoria aleatoria. Si bien se supone que un dispositivo ATA debe abortar un comando ATA_NOP, parece haber un error en libata-sff o QEMU, donde este estado no está establecido o el estado se borra antes de la lectura por ata_sff_hsm_move(). De todos modos, es muy probable que se trate de un error separado. Si analizamos __atapi_pio_bytes(), veremos que ya tiene una comprobación de seguridad para garantizar que __atapi_pio_bytes() no pueda escribir fuera del búfer asignado. Agreguemos una comprobación similar a ata_pio_sector(), de modo que ata_pio_sector() tampoco pueda escribir fuera del búfer asignado.","source":"nvd"}],"published":"2025-02-27T02:12:13.942Z","modified":"2026-10-15T02:17:31.647Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"5a5dbd18a7496ed403f6f54bb20c955c65482fa5","fixed":"a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c","status":"affected"},{"type":"git","introduced":"5a5dbd18a7496ed403f6f54bb20c955c65482fa5","fixed":"d5e6e3000309359eae2a17117aa6e3c44897bf6c","status":"affected"},{"type":"git","introduced":"5a5dbd18a7496ed403f6f54bb20c955c65482fa5","fixed":"0dd5aade301a10f4b329fa7454fdcc2518741902","status":"affected"},{"type":"git","introduced":"5a5dbd18a7496ed403f6f54bb20c955c65482fa5","fixed":"0a17a9944b8d89ef03946121241870ac53ddaf45","status":"affected"},{"type":"git","introduced":"5a5dbd18a7496ed403f6f54bb20c955c65482fa5","fixed":"6e74e53b34b6dec5a50e1404e2680852ec6768d2","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.22","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.22","status":"unaffected"},{"type":"semver","introduced":"6.1.129","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.78","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.14","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.13.3","lastAffected":"6.13.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.14","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"6.1.129"},{"status":"affected","introduced":"6.2","fixed":"6.6.78"},{"status":"affected","introduced":"6.7","fixed":"6.12.14"},{"status":"affected","introduced":"6.13","fixed":"6.13.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d5e6e3000309359eae2a17117aa6e3c44897bf6c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0dd5aade301a10f4b329fa7454fdcc2518741902","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0a17a9944b8d89ef03946121241870ac53ddaf45","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6e74e53b34b6dec5a50e1404e2680852ec6768d2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-784472.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-21738","url":"https://www.cve.org/CVERecord?id=CVE-2025-21738","licence":"CVE Terms of Use","modified":"2026-10-15T01:03:54.067Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-21738","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21738","licence":"Public domain","modified":"2026-10-15T02:17:31.647Z"}],"updatedAt":"2026-11-25T22:58:54.515Z","epss":{"score":0.00224,"percentile":0.13973,"date":"2026-12-01T12:00:22.000Z"}}