CVE-2025-21738
ata: libata-sff: Ensure that we cannot write outside the allocated buffer
Check your servers for CVE-2025-21738
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-21738 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.22%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 13.9% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5, before a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c affected from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5, before d5e6e3000309359eae2a17117aa6e3c44897bf6c affected from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5, before 0dd5aade301a10f4b329fa7454fdcc2518741902 affected from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5, before 0a17a9944b8d89ef03946121241870ac53ddaf45 affected from 5a5dbd18a7496ed403f6f54bb20c955c65482fa5, before 6e74e53b34b6dec5a50e1404e2680852ec6768d2
Other versions: unaffected
|
| Linux |
affected 2.6.22 unaffected before 2.6.22 unaffected from 6.1.129 up to and including 6.1.* unaffected from 6.6.78 up to and including 6.6.* unaffected from 6.12.14 up to and including 6.12.* unaffected from 6.13.3 up to and including 6.13.* unaffected 6.14 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-21738 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-21738
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-21738
trivy image --scanners vuln IMAGE | grep CVE-2025-21738
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/a8f8cf87059ed1905c2a5c72f8b39a4f57b11b4c git.kernel.org
- https://git.kernel.org/stable/c/d5e6e3000309359eae2a17117aa6e3c44897bf6c git.kernel.org
- https://git.kernel.org/stable/c/0dd5aade301a10f4b329fa7454fdcc2518741902 git.kernel.org
- https://git.kernel.org/stable/c/0a17a9944b8d89ef03946121241870ac53ddaf45 git.kernel.org
- https://git.kernel.org/stable/c/6e74e53b34b6dec5a50e1404e2680852ec6768d2 git.kernel.org
- https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html lists.debian.org
- https://cert-portal.siemens.com/productcert/html/ssa-784472.html cert-portal.siemens.com
Source: the record CVE-2025-21738 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse