Look up another CVE · open CVE-2025-21927 in the interactive tracker
CVE-2025-21927
nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()
Published 2025-04-01 (19 months ago) by the Linux kernel CNA. Subsystem drivers/nvme. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2025-21927 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | fixed | 6.12.19-1 | Update the kernel and reboot. Fixed in 6.12.19-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.12.19-1 | Update the kernel and reboot. Fixed in 6.12.19-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.12.19-1 | Update the kernel and reboot. Fixed in 6.12.19-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
nvme_tcp_recv_pdu() doesn't check the validity of the header length. When header digests are enabled, a target might send a packet with an invalid header length (e.g. 255), causing nvme_tcp_verify_hdgst() to access memory outside the allocated area and cause memory corruptions by overwriting it with the calculated digest. Fix this by rejecting packets with an unexpected header length.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
drivers/nvme/host/tcp.c
- What this is
- NVM EXPRESS DRIVERMAINTAINERS section matched on drivers/nvme/host/ · linux-nvme@lists.infradead.org · Supported
- Kernel module
- nvme_tcp
Check it on the machine
grep -w CONFIG_NVME_TCP /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
lsmod | grep -w nvme_tcpPrints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.
Show whether Debian builds this, per release
Debian builds this as a loadable module. Every release below compiles it as a module on every flavour, so whether the code is in the running kernel depends on whether that module is loaded.
- bookworm, trixie, forky, sidm
- m
- a loadable module on every flavour - check lsmod, can be blacklisted
- Build switch
- CONFIG_NVME_TCP
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2025-04-01 (19 months ago)source
- CVSS
- 9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- network (AV:N)source
- EPSS
- 0.50%, higher than 41.1% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- drivers/nvme
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 5.0 | 6.12.19 | 9fbc953d6b38 |
| 5.0 | 6.13.7 | 22b06c89aa6b |
| 5.0 | 6.14 | ad95bab0cd28 |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:NAttack vector, network
- The malformed PDU arrives over a routable TCP connection (NVMe/TCP, typically port 4420/8009) and is parsed by the nvme-tcp host driver's socket receive path; a malicious/compromised NVMe-oF target or an on-path attacker injecting into the stream triggers it from anywhere on the network.
- AC:LAttack complexity, low
- The attacker simply sets hdr->hlen to an arbitrary value (e.g. 255) with the HDGST flag in any rsp/r2t/c2h_data PDU — the out-of-bounds read and 4-byte out-of-bounds write occur deterministically, with no race, no memory-layout dependence, and unlimited retries thanks to the driver's automatic error-recovery reconnect.
- PR:NPrivileges required, none
- The vulnerable parsing happens on any PDU received right after the ICReq/ICResp handshake, before the NVMe Connect command or any DH-HMAC-CHAP authentication, so the remote peer needs no credentials or privileges on the victim host whatsoever.
- UI:NUser interaction, none
- No victim action is needed at attack time — NVMe-oF connections are persistent system configuration established at boot and re-established automatically by nvme_tcp_error_recovery(), so a malicious target or on-path attacker can send the crafted PDU at will.
- S:UScope, unchanged
- The out-of-bounds access corrupts kernel slab memory within the same host kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.
- C:HConfidentiality impact, high
- nvme_tcp_verify_hdgst() reads 4 raw heap bytes at an attacker-chosen offset up to 255 past a 28-byte kmalloc object and dev_err() prints them verbatim ("recv %#x"), giving a repeatable adjacent-heap disclosure primitive; the CRC input additionally hashes up to 227 bytes of out-of-bounds memory.
- I:HIntegrity impact, high
- The CRC32C result is written out of bounds at pdu + hlen, an attacker-chosen offset up to 227 bytes past a kmalloc-32 allocation, corrupting neighbouring slab objects; since 24 of the hashed bytes are attacker-controlled and CRC32C is invertible, heap grooming makes both the offset and the written 32-bit value effectively attacker-chosen — a controlled heap write suitable for control-flow hijacking.
- A:HAvailability impact, high
- The out-of-bounds slab write corrupts adjacent kernel objects and slab metadata, causing oops/panic (immediate BUG under KASAN/hardened SLUB), and the attacker can repeat it across auto-reconnects to reliably crash the host.