{"id":"CVE-2025-21927","state":"PUBLISHED","title":"nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()\n\nnvme_tcp_recv_pdu() doesn't check the validity of the header length.\nWhen header digests are enabled, a target might send a packet with an\ninvalid header length (e.g. 255), causing nvme_tcp_verify_hdgst()\nto access memory outside the allocated area and cause memory corruptions\nby overwriting it with the calculated digest.\n\nFix this by rejecting packets with an unexpected header length.","publishedAt":"2025-04-01T15:40:58.432Z","updatedAt":"2026-10-30T12:21:00.738Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"3b54109b2f771f74fd53b027429796326f84ab36","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"9d22cf5cc94cd7dee84773ec41db78a46107dfa3","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"9fbc953d6b38bc824392e01850f0aeee3b348722","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"22b06c89aa6b2d1ecb8aea72edfb9d53af8d5126","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"ad95bab0cd28ed77c2c0d0b6e76e03e031391064","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/host/tcp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.0","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.19","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.7","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/host/tcp.c"]}],"references":["https://git.kernel.org/stable/c/3b54109b2f771f74fd53b027429796326f84ab36","https://git.kernel.org/stable/c/9d22cf5cc94cd7dee84773ec41db78a46107dfa3","https://git.kernel.org/stable/c/9fbc953d6b38bc824392e01850f0aeee3b348722","https://git.kernel.org/stable/c/22b06c89aa6b2d1ecb8aea72edfb9d53af8d5126","https://git.kernel.org/stable/c/ad95bab0cd28ed77c2c0d0b6e76e03e031391064"],"weaknesses":["CWE-787"],"ingestedAt":"2026-10-30T12:38:04.623Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21927.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21927","state":"PUBLISHED","datePublished":"2025-04-01T15:40:58.432Z","dateUpdated":"2026-10-30T12:21:00.738Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.788Z"},"containers":{"cna":{"title":"nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()\n\nnvme_tcp_recv_pdu() doesn't check the validity of the header length.\nWhen header digests are enabled, a target might send a packet with an\ninvalid header length (e.g. 255), causing nvme_tcp_verify_hdgst()\nto access memory outside the allocated area and cause memory corruptions\nby overwriting it with the calculated digest.\n\nFix this by rejecting packets with an unexpected header length."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"3b54109b2f771f74fd53b027429796326f84ab36","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"9d22cf5cc94cd7dee84773ec41db78a46107dfa3","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"9fbc953d6b38bc824392e01850f0aeee3b348722","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"22b06c89aa6b2d1ecb8aea72edfb9d53af8d5126","versionType":"git"},{"version":"3f2304f8c6d6ed97849057bd16fee99e434ca796","status":"affected","lessThan":"ad95bab0cd28ed77c2c0d0b6e76e03e031391064","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/host/tcp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.0","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.19","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.7","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/host/tcp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/3b54109b2f771f74fd53b027429796326f84ab36"},{"url":"https://git.kernel.org/stable/c/9d22cf5cc94cd7dee84773ec41db78a46107dfa3"},{"url":"https://git.kernel.org/stable/c/9fbc953d6b38bc824392e01850f0aeee3b348722"},{"url":"https://git.kernel.org/stable/c/22b06c89aa6b2d1ecb8aea72edfb9d53af8d5126"},{"url":"https://git.kernel.org/stable/c/ad95bab0cd28ed77c2c0d0b6e76e03e031391064"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - 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.\nAC:L - 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.\nPR:N - 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.\nUI:N - 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.\nS:U - The out-of-bounds access corrupts kernel slab memory within the same host kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - 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.\nI:H - 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.\nA:H - 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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:21:00.738Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.12.19"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.13.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-21927","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-10-01T19:22:21.408514Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-787","lang":"en","type":"CWE","description":"CWE-787 Out-of-bounds Write"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T19:26:33.723Z"}}]}}}