{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-21927",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-21927"
  ],
  "published": "2025-04-01T15:40:16Z",
  "summary": "nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()",
  "details": "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.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": null,
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-21927"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9fbc953d6b38bc824392e01850f0aeee3b348722"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/22b06c89aa6b2d1ecb8aea72edfb9d53af8d5126"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ad95bab0cd28ed77c2c0d0b6e76e03e031391064"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 9.8,
      "cvss_v3_severity": "Critical",
      "scenario": "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 \u2014 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 \u2014 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 \u2014 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."
    }
  }
}
