CVE-2025-38314 (GCVE-0-2025-38314)

Vulnerability from cvelistv5 – Published: 2025-07-10 07:42 – Updated: 2026-08-05 12:01
VLAI
Title
virtio-pci: Fix result size returned for the admin command completion
Summary
In the Linux kernel, the following vulnerability has been resolved: virtio-pci: Fix result size returned for the admin command completion The result size returned by virtio_pci_admin_dev_parts_get() is 8 bytes larger than the actual result data size. This occurs because the result_sg_size field of the command is filled with the result length from virtqueue_get_buf(), which includes both the data size and an additional 8 bytes of status. This oversized result size causes two issues: 1. The state transferred to the destination includes 8 bytes of extra data at the end. 2. The allocated buffer in the kernel may be smaller than the returned size, leading to failures when reading beyond the allocated size. The commit fixes this by subtracting the status size from the result of virtqueue_get_buf(). This fix has been tested through live migrations with virtio-net, virtio-net-transitional, and virtio-blk devices.
Assigner
Linux CNA
Impacted products
Vendor Product Version
Linux Linux Affected: 704806ca400e5daa86c110f14bfdda9d28203bb7 , < 920b6720bb63893b81516c0c45884a8350f9e4bf (git)
Affected: 704806ca400e5daa86c110f14bfdda9d28203bb7 , < 9ef41ebf787fcbde99ac404ae473f8467641f983 (git)
Create a notification for this product.
Linux Linux Affected: 6.13
Unaffected: 0 , < 6.13 (semver)
Unaffected: 6.15.3 , ≤ 6.15.* (semver)
Unaffected: 6.16 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/virtio/virtio_pci_modern.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "920b6720bb63893b81516c0c45884a8350f9e4bf",
              "status": "affected",
              "version": "704806ca400e5daa86c110f14bfdda9d28203bb7",
              "versionType": "git"
            },
            {
              "lessThan": "9ef41ebf787fcbde99ac404ae473f8467641f983",
              "status": "affected",
              "version": "704806ca400e5daa86c110f14bfdda9d28203bb7",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/virtio/virtio_pci_modern.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.13"
            },
            {
              "lessThan": "6.13",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.3",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nvirtio-pci: Fix result size returned for the admin command completion\n\nThe result size returned by virtio_pci_admin_dev_parts_get() is 8 bytes\nlarger than the actual result data size. This occurs because the\nresult_sg_size field of the command is filled with the result length\nfrom virtqueue_get_buf(), which includes both the data size and an\nadditional 8 bytes of status.\n\nThis oversized result size causes two issues:\n1. The state transferred to the destination includes 8 bytes of extra\n   data at the end.\n2. The allocated buffer in the kernel may be smaller than the returned\n   size, leading to failures when reading beyond the allocated size.\n\nThe commit fixes this by subtracting the status size from the result of\nvirtqueue_get_buf().\n\nThis fix has been tested through live migrations with virtio-net,\nvirtio-net-transitional, and virtio-blk devices."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.3,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The buggy completion handler is only driven by admin-vq commands issued from the virtio VFIO variant driver, reached through local `VFIO_DEVICE_FEATURE` migration-state ioctls and `read()` on the migration anon-inode fd. Nothing on the path processes remote or guest-supplied input, so the attacker needs local access to the host\u0027s VFIO device node.\nAC:L - The off-by-8 is unconditional \u2014 every `virtio_pci_admin_dev_parts_get()` completion returns `len` including the status SG, so the attacker simply performs a normal STOP_COPY/PRE_COPY save and reads the fd. There is no race, no timing window, and no dependence on memory layout the attacker cannot influence.\nPR:L - Neither `virtiovf_pci_set_device_state()` nor the save-fd `read()` path performs any capability check; access is gated only by permissions on the VFIO device/group node, which in the standard libvirt/QEMU model are delegated to an unprivileged VMM user. That is low privilege, not genuine host root.\nUI:N - The attacker drives the migration state transition and reads the migration file descriptor entirely on their own. No victim action, cooperation, or pre-existing migration in progress is required.\nS:U - The disclosed data and the failing operation both belong to the host kernel\u0027s own security authority, with the leak flowing to the same userspace process that already owns the VFIO device. No VM, IOMMU, or sandbox boundary is crossed by the defect itself.\nC:H - Because the migration buffer pages are allocated via `alloc_pages_bulk()` without `__GFP_ZERO`, the 8 bytes past the device-written data are stale kernel page contents that `virtiovf_buf_read()` copies to userspace and that are then transmitted off-host to the migration destination. Each save/precopy cycle allocates fresh pages, so the leak can be harvested repeatedly to sample arbitrary previously-freed memory \u2014 kernel pointers, page-cache contents, or other tenants\u0027 data.\nI:L - The inflated size propagates into `virtiovf_add_buf_header()`, so the record written into the migration stream is 8 bytes too long and the destination feeds a corrupted device-parts blob to `virtio_pci_admin_dev_parts_set()`, modifying the migrated guest\u0027s device state. There is no out-of-bounds or attacker-controlled write in kernel memory, so the modification is bounded.\nA:H - Whenever the device-parts size is page-aligned, `res_size` exceeds `buf-\u003eallocated_length` and `virtiovf_get_migration_page()` returns NULL, making every `read()` on the migration fd fail with `-EINVAL` and aborting live migration for that device outright. Combined with the malformed state blob, the migrated guest\u0027s virtio device cannot be restored on the destination, denying availability of the workload being migrated."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:01:06.485Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/920b6720bb63893b81516c0c45884a8350f9e4bf"
        },
        {
          "url": "https://git.kernel.org/stable/c/9ef41ebf787fcbde99ac404ae473f8467641f983"
        }
      ],
      "title": "virtio-pci: Fix result size returned for the admin command completion",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38314",
    "datePublished": "2025-07-10T07:42:21.937Z",
    "dateReserved": "2025-04-16T04:51:24.003Z",
    "dateUpdated": "2026-08-05T12:01:06.485Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-38314",
      "date": "2026-11-19",
      "epss": "0.00147",
      "percentile": "0.04036"
    },
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-11-09T17:41:16+00:00",
      "cve": "CVE-2025-38314",
      "id": "CVE-2025-38314",
      "initial_release_date": "2025-07-10T00:00:00+00:00",
      "product_status:known_affected": "1",
      "product_status:known_not_affected": "199",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: virtio-pci: Fix result size returned for the admin command completion",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-38314.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

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.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.