← Back to CVE Explorer

CVE-2025-40004

Full vulnerability record from the local CVENow database.

Description

In the Linux kernel, the following vulnerability has been resolved: net/9p: Fix buffer overflow in USB transport layer A buffer overflow vulnerability exists in the USB 9pfs transport layer where inconsistent size validation between packet header parsing and actual data copying allows a malicious USB host to overflow heap buffers. The issue occurs because: - usb9pfs_rx_header() validates only the declared size in packet header - usb9pfs_rx_complete() uses req->actual (actual received bytes) for memcpy This allows an attacker to craft packets with small declared size (bypassing validation) but large actual payload (triggering overflow in memcpy). Add validation in usb9pfs_rx_complete() to ensure req->actual does not exceed the buffer capacity before copying data.

Severity
Not scored
CVSS score
Not available
Vulnerability status
Deferred
Source identifier
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Published
2025-10-20 06:15:36.280000
Last modified
2026-10-19 21:10:00.160000
View original CVE JSON
{
  "id": "CVE-2025-40004",
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "published": "2025-10-20T06:15:36.280",
  "lastModified": "2026-10-19T21:10:00.160",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/9p: Fix buffer overflow in USB transport layer\n\nA buffer overflow vulnerability exists in the USB 9pfs transport layer\nwhere inconsistent size validation between packet header parsing and\nactual data copying allows a malicious USB host to overflow heap buffers.\n\nThe issue occurs because:\n- usb9pfs_rx_header() validates only the declared size in packet header\n- usb9pfs_rx_complete() uses req->actual (actual received bytes) for\nmemcpy\n\nThis allows an attacker to craft packets with small declared size\n(bypassing validation) but large actual payload (triggering overflow\nin memcpy).\n\nAdd validation in usb9pfs_rx_complete() to ensure req->actual does not\nexceed the buffer capacity before copying data."
    },
    {
      "lang": "es",
      "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnet/9p: Solucionar desbordamiento de búfer en la capa de transporte USB\n\nExiste una vulnerabilidad de desbordamiento de búfer en la capa de transporte USB 9pfs donde una validación de tamaño inconsistente entre el análisis de la cabecera del paquete y la copia real de datos permite a un host USB malicioso desbordar los búferes de la pila.\n\nEl problema ocurre porque:\n- usb9pfs_rx_header() valida solo el tamaño declarado en la cabecera del paquete\n- usb9pfs_rx_complete() usa req->actual (bytes reales recibidos) para memcpy\n\nEsto permite a un atacante crear paquetes con un tamaño declarado pequeño (eludiendo la validación) pero con una carga útil real grande (desencadenando un desbordamiento en memcpy).\n\nAñadir validación en usb9pfs_rx_complete() para asegurar que req->actual no exceda la capacidad del búfer antes de copiar los datos."
    }
  ],
  "affected": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "affectedData": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "programFiles": [
            "net/9p/trans_usbg.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "a3be076dc174d9022a71a12554feb4c97b5c4d5c",
              "lessThan": "0da18d49f874d444ad83c8a546fa33bfcf2f582c",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "a3be076dc174d9022a71a12554feb4c97b5c4d5c",
              "lessThan": "df8462f0fc045b4475dc494a5787a03c972ba2a2",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "a3be076dc174d9022a71a12554feb4c97b5c4d5c",
              "lessThan": "c04db81cd0288dfc68b7a0f7d09bd49b40bba451",
              "versionType": "git",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "programFiles": [
            "net/9p/trans_usbg.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "6.12",
              "status": "affected"
            },
            {
              "version": "0",
              "lessThan": "6.12",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.12.53",
              "lessThanOrEqual": "6.12.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.17.3",
              "lessThanOrEqual": "6.17.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.18",
              "lessThanOrEqual": "*",
              "versionType": "original_commit_for_fix",
              "status": "unaffected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {},
  "references": [
    {
      "url": "https://git.kernel.org/stable/c/0da18d49f874d444ad83c8a546fa33bfcf2f582c",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/c04db81cd0288dfc68b7a0f7d09bd49b40bba451",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/df8462f0fc045b4475dc494a5787a03c972ba2a2",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ]
}