CVE-2025-38082 (GCVE-0-2025-38082)
Vulnerability from cvelistv5
Published
2025-06-18 09:35
Modified
2026-08-05 11:59
Summary
In the Linux kernel, the following vulnerability has been resolved: gpio: virtuser: fix potential out-of-bound write If the caller wrote more characters, count is truncated to the max available space in "simple_write_to_buffer". Check that the input size does not exceed the buffer size. Write a zero termination afterwards.
Impacted products
Vendor Product Version
Linux Linux Version: 91581c4b3f29e2e22aeb1a62e842d529ca638b2d
Version: 91581c4b3f29e2e22aeb1a62e842d529ca638b2d
Version: 91581c4b3f29e2e22aeb1a62e842d529ca638b2d
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpio/gpio-virtuser.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "afe090366f470f77e140ff3407db813f57852c04",
              "status": "affected",
              "version": "91581c4b3f29e2e22aeb1a62e842d529ca638b2d",
              "versionType": "git"
            },
            {
              "lessThan": "b96feaaa0fda1e3871b438143c3446954b32d3a7",
              "status": "affected",
              "version": "91581c4b3f29e2e22aeb1a62e842d529ca638b2d",
              "versionType": "git"
            },
            {
              "lessThan": "7118be7c6072f40391923543fdd1563b8d56377c",
              "status": "affected",
              "version": "91581c4b3f29e2e22aeb1a62e842d529ca638b2d",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpio/gpio-virtuser.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.11"
            },
            {
              "lessThan": "6.11",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.32",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.14.*",
              "status": "unaffected",
              "version": "6.14.10",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.32",
                  "versionStartIncluding": "6.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14.10",
                  "versionStartIncluding": "6.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15",
                  "versionStartIncluding": "6.11",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ngpio: virtuser: fix potential out-of-bound write\n\nIf the caller wrote more characters, count is truncated to the max\navailable space in \"simple_write_to_buffer\". Check that the input\nsize does not exceed the buffer size. Write a zero termination\nafterwards."
        }
      ],
      "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 - The bug is reached only via a `write(2)`/`pwrite(2)` syscall on the local debugfs files `/sys/kernel/debug/gpio-virtuser/\u003cdev\u003e/\u003cline\u003e/direction` and `.../consumer`. There is no network, remote-peer, or over-the-air input path into the gpio-virtuser driver.\nAC:L - A single unconditional write triggers it deterministically \u2014 a 32-byte write to `direction` guarantees an unterminated buffer and a one-byte OOB store past `buf[32]`, and a zero-length write to `consumer` guarantees `buf[strlen(buf)-1]` evaluates to `buf[-1]` on default `INIT_STACK_ALL_ZERO` kernels. There is no race, no timing window, and no memory-layout precondition outside the attacker\u0027s influence, since the attacker controls both the write length and every byte.\nPR:L - The debugfs nodes are mode 0644 and debugfs defaults to a 0700 root, but the `uid=`/`gid=`/`mode=` mount options and vendor chown policies commonly delegate debugfs to non-root system accounts on the embedded/industrial/automotive boards where a GPIO test-consumer device is instantiated, so a low-privileged local account is the realistic worst case \u2014 consistent with prior kernel CNA debugfs scoring (CVE-2025-38317, CVE-2025-38307).\nUI:N - The attacker performs the write entirely on their own; no victim action, mount, or file-open by another user is required.\nS:U - The corruption and disclosure occur in kernel stack/heap memory within the same kernel security authority, with no VM, IOMMU, or sandbox boundary crossed.\nC:H - `strim()` and `strlen()` read out of bounds past the stack buffer, and the unterminated buffer is handed to `gpiod_set_consumer_name()` \u2192 `desc_set_label()`, which `strcpy()`s the out-of-bounds stack bytes into a label exported to userspace through the debugfs `consumer` read and `GPIO_V2_GET_LINEINFO_IOCTL`; a `pwrite` at offset 31 leaks up to 31 bytes of uninitialized kernel stack, which can contain pointers and defeat KASLR.\nI:H - This is an out-of-bounds write \u2014 a NUL byte stored past the end of `buf[32]` in `direction`, and below the array (`buf[-1]`) or beyond it in `consumer` \u2014 at an offset the attacker can influence by grooming the kernel stack with prior syscalls, yielding a classic poison-NUL-byte primitive able to truncate an adjacent saved pointer or length field into a control-flow hijack.\nA:H - Corrupting adjacent stack locals, the stack-protector canary, or the frame of neighboring calls produces `__stack_chk_fail()` panics or oopses, and the OOB `strlen()` walk can fault; the attacker can repeat the write at will to guarantee a crash."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:59:20.241Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/afe090366f470f77e140ff3407db813f57852c04"
        },
        {
          "url": "https://git.kernel.org/stable/c/b96feaaa0fda1e3871b438143c3446954b32d3a7"
        },
        {
          "url": "https://git.kernel.org/stable/c/7118be7c6072f40391923543fdd1563b8d56377c"
        }
      ],
      "title": "gpio: virtuser: fix potential out-of-bound write",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38082",
    "datePublished": "2025-06-18T09:35:41.902Z",
    "dateReserved": "2025-04-16T04:51:23.981Z",
    "dateUpdated": "2026-08-05T11:59:20.241Z",
    "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…