CVE-2025-40302 (GCVE-0-2025-40302)

Vulnerability from cvelistv5 – Published: 2025-12-08 00:46 – Updated: 2026-08-05 12:09
VLAI
Title
media: videobuf2: forbid remove_bufs when legacy fileio is active
Summary
In the Linux kernel, the following vulnerability has been resolved: media: videobuf2: forbid remove_bufs when legacy fileio is active vb2_ioctl_remove_bufs() call manipulates queue internal buffer list, potentially overwriting some pointers used by the legacy fileio access mode. Forbid that ioctl when fileio is active to protect internal queue state between subsequent read/write calls.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: a3293a85381ec9680aa2929547fbc76c5d87a1b2 , < a6a493b985bfffac097a4e1be09f98b27729dca8 (git)
Affected: a3293a85381ec9680aa2929547fbc76c5d87a1b2 , < e819b34df0a7030a15c968d619fa8a3ed2455c7a (git)
Affected: a3293a85381ec9680aa2929547fbc76c5d87a1b2 , < 27afd6e066cfd80ddbe22a4a11b99174ac89cced (git)
Create a notification for this product.
Linux Linux Affected: 6.10
Unaffected: 0 , < 6.10 (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/media/common/videobuf2/videobuf2-v4l2.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "a6a493b985bfffac097a4e1be09f98b27729dca8",
              "status": "affected",
              "version": "a3293a85381ec9680aa2929547fbc76c5d87a1b2",
              "versionType": "git"
            },
            {
              "lessThan": "e819b34df0a7030a15c968d619fa8a3ed2455c7a",
              "status": "affected",
              "version": "a3293a85381ec9680aa2929547fbc76c5d87a1b2",
              "versionType": "git"
            },
            {
              "lessThan": "27afd6e066cfd80ddbe22a4a11b99174ac89cced",
              "status": "affected",
              "version": "a3293a85381ec9680aa2929547fbc76c5d87a1b2",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/media/common/videobuf2/videobuf2-v4l2.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.10"
            },
            {
              "lessThan": "6.10",
              "status": "unaffected",
              "version": "0",
              "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.12.58",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.8",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: videobuf2: forbid remove_bufs when legacy fileio is active\n\nvb2_ioctl_remove_bufs() call manipulates queue internal buffer list,\npotentially overwriting some pointers used by the legacy fileio access\nmode. Forbid that ioctl when fileio is active to protect internal queue\nstate between subsequent read/write calls."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - Exploitation requires opening a V4L2 device node (/dev/videoN) and issuing read()/write() plus the VIDIOC_REMOVE_BUFS ioctl from a local process. There is no network-reachable path into videobuf2\u0027s legacy fileio emulator.\nAC:L - The attack is a purely sequential, deterministic three-step sequence on a single file descriptor (read/write \u2192 REMOVE_BUFS \u2192 read/write) with no race window; the same fd owns the queue so vb2_queue_is_busy() never blocks it. No special memory layout or timing beyond attacker control is required.\nPR:L - Any local unprivileged user with access to the video device node can trigger this \u2014 desktop distros grant the active session user access via logind uaccess ACLs/the video group, and Android/embedded camera sandboxes expose these nodes directly. No CAP_SYS_ADMIN or other capability is checked on the ioctl path.\nUI:N - The attacking process performs every step itself on its own file descriptor; no victim action, mount, or plug-in event is needed.\nS:U - The corruption is confined to kernel memory within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed.\nC:H - After the buffers are freed, __vb2_perform_fileio() still does copy_to_user(data, buf-\u003evaddr + buf-\u003epos, count) using the stale cached kernel address, disclosing up to a full frame (potentially megabytes) of freed kernel memory \u2014 reusable by kernel stacks, slab objects, or page tables \u2014 directly to userspace.\nI:H - On output/write queues the same stale pointer is used in copy_from_user(buf-\u003evaddr + buf-\u003epos, data, count), giving an attacker-controlled write of arbitrary length into freed kernel memory (vfree\u0027d vmalloc region reusable by VMAP kernel stacks, or page-allocator pages with dma-contig), a classic UAF write primitive for privilege escalation; a NULL-pointer write via b-\u003eplanes[0].bytesused also occurs.\nA:H - vb2_get_buffer() returns NULL for the removed index despite the code asserting it \"can never be NULL when using fileio\", producing a NULL-pointer dereference oops, and the use-after-free of vfree\u0027d vmalloc addresses causes unrecoverable kernel faults."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:09:21.585Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/a6a493b985bfffac097a4e1be09f98b27729dca8"
        },
        {
          "url": "https://git.kernel.org/stable/c/e819b34df0a7030a15c968d619fa8a3ed2455c7a"
        },
        {
          "url": "https://git.kernel.org/stable/c/27afd6e066cfd80ddbe22a4a11b99174ac89cced"
        }
      ],
      "title": "media: videobuf2: forbid remove_bufs when legacy fileio is active",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40302",
    "datePublished": "2025-12-08T00:46:26.293Z",
    "dateReserved": "2025-04-16T07:20:57.185Z",
    "dateUpdated": "2026-08-05T12:09:21.585Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-40302",
      "date": "2026-08-10",
      "epss": "0.00139",
      "percentile": "0.03693"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40302\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-12-08T01:16:02.313\",\"lastModified\":\"2026-07-30T06:24:27.373\",\"vulnStatus\":\"Deferred\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmedia: videobuf2: forbid remove_bufs when legacy fileio is active\\n\\nvb2_ioctl_remove_bufs() call manipulates queue internal buffer list,\\npotentially overwriting some pointers used by the legacy fileio access\\nmode. Forbid that ioctl when fileio is active to protect internal queue\\nstate between subsequent read/write calls.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"drivers/media/common/videobuf2/videobuf2-v4l2.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"a3293a85381ec9680aa2929547fbc76c5d87a1b2\",\"lessThan\":\"a6a493b985bfffac097a4e1be09f98b27729dca8\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a3293a85381ec9680aa2929547fbc76c5d87a1b2\",\"lessThan\":\"e819b34df0a7030a15c968d619fa8a3ed2455c7a\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a3293a85381ec9680aa2929547fbc76c5d87a1b2\",\"lessThan\":\"27afd6e066cfd80ddbe22a4a11b99174ac89cced\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"drivers/media/common/videobuf2/videobuf2-v4l2.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"6.10\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.10\",\"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:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/27afd6e066cfd80ddbe22a4a11b99174ac89cced\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a6a493b985bfffac097a4e1be09f98b27729dca8\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e819b34df0a7030a15c968d619fa8a3ed2455c7a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}",
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-07-30T08:38:02+00:00",
      "cve": "CVE-2025-40302",
      "id": "CVE-2025-40302",
      "initial_release_date": "2025-12-08T00:00:00+00:00",
      "product_status:known_affected": "184",
      "product_status:known_not_affected": "90",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: media: videobuf2: forbid remove_bufs when legacy fileio is active",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-40302.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-07-25T00:31:44Z",
      "cve": "CVE-2025-40302",
      "id": "CVE-2025-40302",
      "initial_release_date": "2025-12-09T00:24:35Z",
      "product_status:first_fixed": "2",
      "product_status:known_affected": "394",
      "product_status:known_not_affected": "354",
      "product_status:recommended": "283",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-40302",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-40302.json",
      "version": "26"
    }
  }
}



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…

Loading…