Skip to content
Heist/ feed
Back to feed
HighFix available

virtio-net: xsk: rx: fix the frame's length check

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: virtio-net: xsk: rx: fix the frame's length check When calling buf_to_xdp, the len argument is the frame data's length without virtio header's length (vi->hdr_len). We check that len with xsk_pool_get_rx_frame_size() + vi->hdr_len to ensure the provided len does not larger than the allocated chunk size. The additional vi->hdr_len is because in virtnet_add_recvbuf_xsk, we use part of XDP_PACKET_HEADROOM for virtio header and ask the vhost to start placing data from hard_start + XDP_PACKET_HEADROOM - vi->hdr_len not hard_start + XDP_PACKET_HEADROOM But the first buffer has virtio_header, so the maximum frame's length in the first buffer can only be xsk_pool_get_rx_frame_size() not xsk_pool_get_rx_frame_size() + vi->hdr_len like in the current check. This commit adds an additional argument to buf_to_xdp differentiate between the first buffer and other ones to correctly calculate the maximum frame's length.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.12.37, 6.15.6
CVEs
CVE-2025-38413
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 08:07 UTC · Revision 1

Source evidence

virtio-net: xsk: rx: fix the frame's length check

core-osv · Original source

Published 25 Jul 2025, 13:20 UTC

In the Linux kernel, the following vulnerability has been resolved: virtio-net: xsk: rx: fix the frame's length check When calling buf_to_xdp, the len argument is the frame data's length without virtio header's length (vi->hdr_len). We check that len with xsk_pool_get_rx_frame_size() + vi->hdr_len to ensure the provided len does not larger than the allocated chunk size. The additional vi->hdr_len is because in virtnet_add_recvbuf_xsk, we use part of XDP_PACKET_HEADROOM for virtio header and ask the vhost to start placing data from hard_start + XDP_PACKET_HEADROOM - vi->hdr_len not hard_start + XDP_PACKET_HEADROOM But the first buffer has virtio_header, so the maximum frame's length in the first buffer can only be xsk_pool_get_rx_frame_size() not xsk_pool_get_rx_frame_size() + vi->hdr_len like in the current check. This commit adds an additional argument to buf_to_xdp differentiate between the first buffer and other ones to correctly calculate the maximum frame's length.

osv:CVE-2025-38413

Kernel

Fixed versions: 6.12.37, 6.15.6

Complete source record
{
  "id": "e58d3a270c427ffabe0deb0282fcc1986948c24edd7f185723bb1fcd16692546",
  "url": "https://osv.dev/vulnerability/CVE-2025-38413",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "virtio-net: xsk: rx: fix the frame's length check",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: virtio-net: xsk: rx: fix the frame's length check When calling buf_to_xdp, the len argument is the frame data's length without virtio header's length (vi->hdr_len). We check that len with xsk_pool_get_rx_frame_size() + vi->hdr_len to ensure the provided len does not larger than the allocated chunk size. The additional vi->hdr_len is because in virtnet_add_recvbuf_xsk, we use part of XDP_PACKET_HEADROOM for virtio header and ask the vhost to start placing data from hard_start + XDP_PACKET_HEADROOM - vi->hdr_len not hard_start + XDP_PACKET_HEADROOM But the first buffer has virtio_header, so the maximum frame's length in the first buffer can only be xsk_pool_get_rx_frame_size() not xsk_pool_get_rx_frame_size() + vi->hdr_len like in the current check. This commit adds an additional argument to buf_to_xdp differentiate between the first buffer and other ones to correctly calculate the maximum frame's length.",
    "evidence": "osv:CVE-2025-38413",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.12.37",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.15.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2025-38413",
      "aliases": [
        "CVE-2025-38413"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "a4e7ba7027012f009f22a68bcfde670f9298d3a4"
                },
                {
                  "fixed": "892f6ed9a4a38bb3360fdff091b9241cfa105b61"
                },
                {
                  "fixed": "6013bb6bc24c2cac3f45b37a15b71b232a5b00ff"
                },
                {
                  "fixed": "5177373c31318c3c6a190383bfd232e6cf565c36"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38413.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.11.0"
                },
                {
                  "fixed": "6.12.37"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.15.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38413.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:50.333072693Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/5177373c31318c3c6a190383bfd232e6cf565c36",
        "https://git.kernel.org/stable/c/6013bb6bc24c2cac3f45b37a15b71b232a5b00ff",
        "https://git.kernel.org/stable/c/892f6ed9a4a38bb3360fdff091b9241cfa105b61",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38413.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-38413",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38413.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-38413",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 518709,
  "published_at": "2025-07-25T13:20:17.394+00:00"
}