CVE-2025-40292 (GCVE-0-2025-40292)
Vulnerability from cvelistv5
Published
2025-12-08 00:46
Modified
2026-08-05 12:09
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.
Impacted products
Vendor Product Version
Linux Linux Version: 4959aebba8c06992abafa09d1e80965e0825af54
Version: 4959aebba8c06992abafa09d1e80965e0825af54
Version: 4959aebba8c06992abafa09d1e80965e0825af54
Version: 4959aebba8c06992abafa09d1e80965e0825af54
Version: 4959aebba8c06992abafa09d1e80965e0825af54
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"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…