CVE-2025-40292 (GCVE-0-2025-40292)

Vulnerability from cvelistv5 – Published: 2025-12-08 00:46 – Updated: 2026-08-05 12:09
VLAI
Title
virtio-net: fix received length check in big packets
Summary
In the Linux kernel, the following vulnerability has been resolved: virtio-net: fix received length check in big packets Since commit 4959aebba8c0 ("virtio-net: use mtu size as buffer length for big packets"), when guest gso is off, the allocated size for big packets is not MAX_SKB_FRAGS * PAGE_SIZE anymore but depends on negotiated MTU. The number of allocated frags for big packets is stored in vi->big_packets_num_skbfrags. Because the host announced buffer length can be malicious (e.g. the host vhost_net driver's get_rx_bufs is modified to announce incorrect length), we need a check in virtio_net receive path. Currently, the check is not adapted to the new change which can lead to NULL page pointer dereference in the below while loop when receiving length that is larger than the allocated one. This commit fixes the received length check corresponding to the new change.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 4959aebba8c06992abafa09d1e80965e0825af54 , < 82f9028e83944a9eee5229cbc6fee9be1de8a62d (git)
Affected: 4959aebba8c06992abafa09d1e80965e0825af54 , < 946dec89c41726b94d31147ec528b96af0be1b5a (git)
Affected: 4959aebba8c06992abafa09d1e80965e0825af54 , < 82fe78065450d2d07f36a22e2b6b44955cf5ca5b (git)
Affected: 4959aebba8c06992abafa09d1e80965e0825af54 , < 3e9d89f2ecd3636bd4cbdfd0b2dfdaf58f9882e2 (git)
Affected: 4959aebba8c06992abafa09d1e80965e0825af54 , < 0c716703965ffc5ef4311b65cb5d84a703784717 (git)
Create a notification for this product.
Linux Linux Affected: 6.1
Unaffected: 0 , < 6.1 (semver)
Unaffected: 6.1.159 , ≤ 6.1.* (semver)
Unaffected: 6.6.117 , ≤ 6.6.* (semver)
Unaffected: 6.12.58 , ≤ 6.12.* (semver)
Unaffected: 6.17.8 , ≤ 6.17.* (semver)
Unaffected: 6.18 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/virtio_net.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "82f9028e83944a9eee5229cbc6fee9be1de8a62d",
              "status": "affected",
              "version": "4959aebba8c06992abafa09d1e80965e0825af54",
              "versionType": "git"
            },
            {
              "lessThan": "946dec89c41726b94d31147ec528b96af0be1b5a",
              "status": "affected",
              "version": "4959aebba8c06992abafa09d1e80965e0825af54",
              "versionType": "git"
            },
            {
              "lessThan": "82fe78065450d2d07f36a22e2b6b44955cf5ca5b",
              "status": "affected",
              "version": "4959aebba8c06992abafa09d1e80965e0825af54",
              "versionType": "git"
            },
            {
              "lessThan": "3e9d89f2ecd3636bd4cbdfd0b2dfdaf58f9882e2",
              "status": "affected",
              "version": "4959aebba8c06992abafa09d1e80965e0825af54",
              "versionType": "git"
            },
            {
              "lessThan": "0c716703965ffc5ef4311b65cb5d84a703784717",
              "status": "affected",
              "version": "4959aebba8c06992abafa09d1e80965e0825af54",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/virtio_net.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.1"
            },
            {
              "lessThan": "6.1",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.159",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.117",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.58",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.8",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.159",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.117",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.58",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.8",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nvirtio-net: fix received length check in big packets\n\nSince commit 4959aebba8c0 (\"virtio-net: use mtu size as buffer length\nfor big packets\"), when guest gso is off, the allocated size for big\npackets is not MAX_SKB_FRAGS * PAGE_SIZE anymore but depends on\nnegotiated MTU. The number of allocated frags for big packets is stored\nin vi-\u003ebig_packets_num_skbfrags.\n\nBecause the host announced buffer length can be malicious (e.g. the host\nvhost_net driver\u0027s get_rx_bufs is modified to announce incorrect\nlength), we need a check in virtio_net receive path. Currently, the\ncheck is not adapted to the new change which can lead to NULL page\npointer dereference in the below while loop when receiving length that\nis larger than the allocated one.\n\nThis commit fixes the received length check corresponding to the new\nchange."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 8.4,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The malicious input is the buffer length announced by the virtio-net backend/device over the virtqueue used-ring, not data from a network peer, so the attacker must be the local hypervisor/vhost backend or an attached virtio/vDPA device. This matches the CNA\u0027s treatment of comparable malicious-virtio-device bugs (CVE-2026-64456, CVE-2026-64490, CVE-2026-46123).\nAC:L - The same backend that announces the bogus length also controls feature negotiation and the advertised MTU, so it can deterministically create the vulnerable configuration (no MRG_RXBUF, no guest GSO, MTU \u003e 1500) and then announce any length up to MAX_SKB_FRAGS * PAGE_SIZE. No race, no memory-layout luck, and it can be repeated on every received packet.\nPR:N - The attacker acts from outside the guest\u0027s privilege model entirely \u2014 a compromised host/vhost_net or hostile virtio device holds no guest credentials and needs none, and the RX path runs unconditionally once the interface is up. Consistent with PR:N on the analogous virtio device-to-guest CVEs.\nUI:N - The corrupted length is consumed automatically in the NAPI receive path as soon as the backend completes a buffer; no guest user action is needed beyond the NIC being up.\nS:U - The vulnerable component and the impacted component are both the guest kernel \u2014 memory corruption stays within the guest\u0027s virtio-net driver and skb allocations. No IOMMU, VM, or sandbox boundary is crossed by the impact itself.\nC:H - An inflated length builds an skb whose fragments cover recycled driver pages that were never written by the device, disclosing stale kernel page contents (prior packet data) up the RX stack to guest userspace or back onto the wire, and the out-of-bounds frag-array write is memory corruption leverageable for further disclosure.\nI:H - With a backend-advertised MTU \u2265 61441, `big_packets_num_skbfrags` reaches 16 and the loop writes `skb_shinfo(skb)-\u003efrags[17]`, an out-of-bounds write of an attacker-influenced frag descriptor (size field) past the fixed `frags[MAX_SKB_FRAGS]` array into adjacent heap memory, plus corruption of `nr_frags`/`skb-\u003elen` \u2014 exactly the OOB write called out in the follow-up fix e6b8463b7d79.\nA:H - Once the page chain is exhausted, `skb_add_rx_frag()` dereferences a NULL `struct page` (`compound_head`/`page_is_pfmemalloc`) and the loop then reads `NULL-\u003eprivate`, causing a guest kernel oops in softirq context; it is trivially repeatable on every packet."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:09:18.395Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/82f9028e83944a9eee5229cbc6fee9be1de8a62d"
        },
        {
          "url": "https://git.kernel.org/stable/c/946dec89c41726b94d31147ec528b96af0be1b5a"
        },
        {
          "url": "https://git.kernel.org/stable/c/82fe78065450d2d07f36a22e2b6b44955cf5ca5b"
        },
        {
          "url": "https://git.kernel.org/stable/c/3e9d89f2ecd3636bd4cbdfd0b2dfdaf58f9882e2"
        },
        {
          "url": "https://git.kernel.org/stable/c/0c716703965ffc5ef4311b65cb5d84a703784717"
        }
      ],
      "title": "virtio-net: fix received length check in big packets",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40292",
    "datePublished": "2025-12-08T00:46:15.761Z",
    "dateReserved": "2025-04-16T07:20:57.185Z",
    "dateUpdated": "2026-08-05T12:09:18.395Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-40292",
      "date": "2026-08-05",
      "epss": "0.00166",
      "percentile": "0.06213"
    },
    "microsoft_vex": {
      "current_release_date": "2025-12-16T14:38:45.000Z",
      "cve": "CVE-2025-40292",
      "id": "msrc_CVE-2025-40292",
      "initial_release_date": "2025-12-02T00:00:00.000Z",
      "product_status:fixed": "1",
      "product_status:known_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "virtio-net: fix received length check in big packets",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2025-40292.json",
      "version": "2"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40292\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-12-08T01:16:01.160\",\"lastModified\":\"2026-07-30T06:24:27.060\",\"vulnStatus\":\"Deferred\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nvirtio-net: fix received length check in big packets\\n\\nSince commit 4959aebba8c0 (\\\"virtio-net: use mtu size as buffer length\\nfor big packets\\\"), when guest gso is off, the allocated size for big\\npackets is not MAX_SKB_FRAGS * PAGE_SIZE anymore but depends on\\nnegotiated MTU. The number of allocated frags for big packets is stored\\nin vi-\u003ebig_packets_num_skbfrags.\\n\\nBecause the host announced buffer length can be malicious (e.g. the host\\nvhost_net driver\u0027s get_rx_bufs is modified to announce incorrect\\nlength), we need a check in virtio_net receive path. Currently, the\\ncheck is not adapted to the new change which can lead to NULL page\\npointer dereference in the below while loop when receiving length that\\nis larger than the allocated one.\\n\\nThis commit fixes the received length check corresponding to the new\\nchange.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"drivers/net/virtio_net.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"4959aebba8c06992abafa09d1e80965e0825af54\",\"lessThan\":\"82f9028e83944a9eee5229cbc6fee9be1de8a62d\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"4959aebba8c06992abafa09d1e80965e0825af54\",\"lessThan\":\"946dec89c41726b94d31147ec528b96af0be1b5a\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"4959aebba8c06992abafa09d1e80965e0825af54\",\"lessThan\":\"82fe78065450d2d07f36a22e2b6b44955cf5ca5b\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"4959aebba8c06992abafa09d1e80965e0825af54\",\"lessThan\":\"3e9d89f2ecd3636bd4cbdfd0b2dfdaf58f9882e2\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"4959aebba8c06992abafa09d1e80965e0825af54\",\"lessThan\":\"0c716703965ffc5ef4311b65cb5d84a703784717\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"drivers/net/virtio_net.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"6.1\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.1\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.1.159\",\"lessThanOrEqual\":\"6.1.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.6.117\",\"lessThanOrEqual\":\"6.6.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.58\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.17.8\",\"lessThanOrEqual\":\"6.17.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.18\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":8.4,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":2.5,\"impactScore\":5.9}]},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/0c716703965ffc5ef4311b65cb5d84a703784717\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3e9d89f2ecd3636bd4cbdfd0b2dfdaf58f9882e2\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/82f9028e83944a9eee5229cbc6fee9be1de8a62d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/82fe78065450d2d07f36a22e2b6b44955cf5ca5b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/946dec89c41726b94d31147ec528b96af0be1b5a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}",
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-07-30T08:38:27+00:00",
      "cve": "CVE-2025-40292",
      "id": "CVE-2025-40292",
      "initial_release_date": "2025-12-08T00:00:00+00:00",
      "product_status:known_affected": "198",
      "product_status:known_not_affected": "76",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: virtio-net: fix received length check in big packets",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-40292.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…