CVE-2025-38555 (GCVE-0-2025-38555)
Vulnerability from cvelistv5
Published
2025-08-19 17:02
Modified
2026-08-05 12:02
Summary
In the Linux kernel, the following vulnerability has been resolved: usb: gadget : fix use-after-free in composite_dev_cleanup() 1. In func configfs_composite_bind() -> composite_os_desc_req_prepare(): if kmalloc fails, the pointer cdev->os_desc_req will be freed but not set to NULL. Then it will return a failure to the upper-level function. 2. in func configfs_composite_bind() -> composite_dev_cleanup(): it will checks whether cdev->os_desc_req is NULL. If it is not NULL, it will attempt to use it.This will lead to a use-after-free issue. BUG: KASAN: use-after-free in composite_dev_cleanup+0xf4/0x2c0 Read of size 8 at addr 0000004827837a00 by task init/1 CPU: 10 PID: 1 Comm: init Tainted: G O 5.10.97-oh #1 kasan_report+0x188/0x1cc __asan_load8+0xb4/0xbc composite_dev_cleanup+0xf4/0x2c0 configfs_composite_bind+0x210/0x7ac udc_bind_to_driver+0xb4/0x1ec usb_gadget_probe_driver+0xec/0x21c gadget_dev_desc_UDC_store+0x264/0x27c
Impacted products
Vendor Product Version
Linux Linux Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Version: 37a3a533429ef9b3cc9f15a656c19623f0e88df7
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T17:39:48.711Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"
          },
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/composite.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "dba96dfa5a0f685b959dd28a52ac8dab0b805204",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "2db29235e900a084a656dea7e0939b0abb7bb897",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "8afb22aa063f706f3343707cdfb8cda4d021dd33",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "e624bf26127645a2f7821e73fdf6dc64bad07835",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "aada327a9f8028c573636fa60c0abc80fb8135c9",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "5f06ee9f9a3665d43133f125c17e5258a13f3963",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "bd3c4ef60baf7f65c963f3e12d9d7b2b091e20ba",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "e1be1f380c82a69f80c68c96a7cfe8759fb30355",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            },
            {
              "lessThan": "151c0aa896c47a4459e07fee7d4843f44c1bb18e",
              "status": "affected",
              "version": "37a3a533429ef9b3cc9f15a656c19623f0e88df7",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/composite.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "3.16"
            },
            {
              "lessThan": "3.16",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.297",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.241",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.190",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.148",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.102",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.42",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.10",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.16.*",
              "status": "unaffected",
              "version": "6.16.1",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.17",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.297",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.241",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.190",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.148",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.102",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.42",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.10",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16.1",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17",
                  "versionStartIncluding": "3.16",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget : fix use-after-free in composite_dev_cleanup()\n\n1. In func configfs_composite_bind() -\u003e composite_os_desc_req_prepare():\nif kmalloc fails, the pointer cdev-\u003eos_desc_req will be freed but not\nset to NULL. Then it will return a failure to the upper-level function.\n2. in func configfs_composite_bind() -\u003e composite_dev_cleanup():\nit will checks whether cdev-\u003eos_desc_req is NULL. If it is not NULL, it\nwill attempt to use it.This will lead to a use-after-free issue.\n\nBUG: KASAN: use-after-free in composite_dev_cleanup+0xf4/0x2c0\nRead of size 8 at addr 0000004827837a00 by task init/1\n\nCPU: 10 PID: 1 Comm: init Tainted: G           O      5.10.97-oh #1\n kasan_report+0x188/0x1cc\n __asan_load8+0xb4/0xbc\n composite_dev_cleanup+0xf4/0x2c0\n configfs_composite_bind+0x210/0x7ac\n udc_bind_to_driver+0xb4/0x1ec\n usb_gadget_probe_driver+0xec/0x21c\n gadget_dev_desc_UDC_store+0x264/0x27c"
        }
      ],
      "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 vulnerability is reached entirely from local userspace by writing to the gadget\u0027s configfs `UDC` attribute (`gadget_dev_desc_UDC_store()` \u2192 `udc_bind_to_driver()` \u2192 `configfs_composite_bind()`); no USB bus traffic, attached host, or physical device access participates in triggering it. Despite being in the USB gadget stack, the trigger is a plain local file write, so Local is both accurate and higher severity than Physical.\nAC:L - Once the 4 KB `kmalloc()` returns NULL the dangling `cdev-\u003eos_desc_req` is dereferenced deterministically on the unwind path with no race to win, and the attacker controls every other precondition (`os_desc` group enabled to set `use_os_string`, unlimited retries of the `UDC` write) while driving the system toward the allocation failure with ordinary memory pressure. The long `purge_configs_funcs()` window between free and use also lets the attacker reliably spray the freed slab object rather than depending on unknowable layout.\nPR:L - configfs is not mountable from a user namespace, but the `/sys/kernel/config/usb_gadget` tree is commonly delegated to a non-root service account (Android\u0027s system-uid USB gadget HAL, embedded gadget managers), so an unprivileged-but-delegated local account can create the `os_desc` configuration and write `UDC`. No capability check guards the store handler itself beyond file ownership.\nUI:N - The attacker performs the whole sequence \u2014 building the gadget, enabling OS descriptors, generating memory pressure, and writing `UDC` \u2014 with no action required from any other user or administrator. The use-after-free fires inside the attacker\u0027s own write syscall.\nS:U - The corruption occurs in kernel slab memory during the calling task\u0027s own syscall and stays within the kernel\u0027s security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `composite_dev_cleanup()` reads `cdev-\u003eos_desc_req-\u003ebuf` out of a freed slab object after a long reclaim window, and an attacker who sprays that object controls the value used for a subsequent `kfree()`, turning the UAF into a heap-manipulation primitive that can be leveraged to read arbitrary kernel memory. Per kernel scoring guidance, a use-after-free is High confidentiality impact.\nI:H - The stale pointer yields `kfree()` of an attacker-influenced pointer plus a NULL write into the reclaimed object and then a second free of the already-freed `usb_request` \u2014 an arbitrary-free and double-free combination that is a well-established route to slab corruption, arbitrary write, and control-flow hijack.\nA:H - Even without exploitation the double free and freeing of a bogus `buf` pointer corrupt the SLUB freelist and reliably produce a KASAN report, BUG, or kernel panic \u2014 the reporter\u0027s own trace shows the oops occurring in PID 1 (`init`), which is fatal to the system."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:02:53.142Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/dba96dfa5a0f685b959dd28a52ac8dab0b805204"
        },
        {
          "url": "https://git.kernel.org/stable/c/2db29235e900a084a656dea7e0939b0abb7bb897"
        },
        {
          "url": "https://git.kernel.org/stable/c/8afb22aa063f706f3343707cdfb8cda4d021dd33"
        },
        {
          "url": "https://git.kernel.org/stable/c/e624bf26127645a2f7821e73fdf6dc64bad07835"
        },
        {
          "url": "https://git.kernel.org/stable/c/aada327a9f8028c573636fa60c0abc80fb8135c9"
        },
        {
          "url": "https://git.kernel.org/stable/c/5f06ee9f9a3665d43133f125c17e5258a13f3963"
        },
        {
          "url": "https://git.kernel.org/stable/c/bd3c4ef60baf7f65c963f3e12d9d7b2b091e20ba"
        },
        {
          "url": "https://git.kernel.org/stable/c/e1be1f380c82a69f80c68c96a7cfe8759fb30355"
        },
        {
          "url": "https://git.kernel.org/stable/c/151c0aa896c47a4459e07fee7d4843f44c1bb18e"
        }
      ],
      "title": "usb: gadget : fix use-after-free in composite_dev_cleanup()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38555",
    "datePublished": "2025-08-19T17:02:34.110Z",
    "dateReserved": "2025-04-16T04:51:24.025Z",
    "dateUpdated": "2026-08-05T12:02:53.142Z",
    "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…