GHSA-2G29-XQ2M-QCRF

Vulnerability from github – Published: 2026-10-18 18:32 – Updated: 2026-10-30 15:34
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

usb: gadget: f_fs: Fix NULL pointer dereference in FUNCTIONFS_ENDPOINT_DESC

When user space sets up FunctionFS with only full-speed descriptors (e.g., flags = FUNCTIONFS_HAS_FS_DESC) and the gadget operates at a higher speed (such as USB_SPEED_HIGH or USB_SPEED_SUPER), config_ep_by_speed() detects that the function lacks descriptors for the current speed, logs a warning, and falls back to full-speed descriptors. The endpoint is then successfully enabled via usb_ep_enable(), and epfile->ep becomes valid.

However, when user space subsequently issues the FUNCTIONFS_ENDPOINT_DESC ioctl to query the endpoint descriptor, ffs_epfile_ioctl() selects the descriptor index solely based on gadget->speed:

switch (epfile->ffs->gadget->speed) {
case USB_SPEED_SUPER:
case USB_SPEED_SUPER_PLUS:
    desc_idx = 2;
    break;
case USB_SPEED_HIGH:
    desc_idx = 1;
    break;
default:
    desc_idx = 0;
}
desc = epfile->ep->descs[desc_idx];
memcpy(&desc1, desc, desc->bLength);

Because user space only supplied full-speed descriptors, epfile->ep->descs[1] is NULL. Dereferencing desc->bLength triggers an immediate kernel NULL pointer dereference panic.

Fix this by falling back through lower speed descriptors if the current speed descriptor was not supplied, matching the fallback logic in config_ep_by_speed() and historical f_fs behavior. If still missing, fall back to epfile->ep->ep->desc (the active descriptor), and return -EINVAL safely if no valid descriptor is found. In addition, mark desc as const to match struct usb_ep::desc and avoid discarding qualifiers.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-98764"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-10-18T16:17:30Z",
    "severity": null
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_fs: Fix NULL pointer dereference in FUNCTIONFS_ENDPOINT_DESC\n\nWhen user space sets up FunctionFS with only full-speed descriptors\n(e.g., flags = FUNCTIONFS_HAS_FS_DESC) and the gadget operates at a\nhigher speed (such as USB_SPEED_HIGH or USB_SPEED_SUPER),\nconfig_ep_by_speed() detects that the function lacks descriptors for\nthe current speed, logs a warning, and falls back to full-speed\ndescriptors. The endpoint is then successfully enabled via\nusb_ep_enable(), and epfile-\u003eep becomes valid.\n\nHowever, when user space subsequently issues the FUNCTIONFS_ENDPOINT_DESC\nioctl to query the endpoint descriptor, ffs_epfile_ioctl() selects the\ndescriptor index solely based on gadget-\u003espeed:\n\n\tswitch (epfile-\u003effs-\u003egadget-\u003espeed) {\n\tcase USB_SPEED_SUPER:\n\tcase USB_SPEED_SUPER_PLUS:\n\t\tdesc_idx = 2;\n\t\tbreak;\n\tcase USB_SPEED_HIGH:\n\t\tdesc_idx = 1;\n\t\tbreak;\n\tdefault:\n\t\tdesc_idx = 0;\n\t}\n\tdesc = epfile-\u003eep-\u003edescs[desc_idx];\n\tmemcpy(\u0026desc1, desc, desc-\u003ebLength);\n\nBecause user space only supplied full-speed descriptors,\nepfile-\u003eep-\u003edescs[1] is NULL. Dereferencing desc-\u003ebLength triggers an\nimmediate kernel NULL pointer dereference panic.\n\nFix this by falling back through lower speed descriptors if the current\nspeed descriptor was not supplied, matching the fallback logic in\nconfig_ep_by_speed() and historical f_fs behavior. If still missing,\nfall back to epfile-\u003eep-\u003eep-\u003edesc (the active descriptor), and return\n-EINVAL safely if no valid descriptor is found. In addition, mark desc\nas const to match struct usb_ep::desc and avoid discarding qualifiers.",
  "id": "GHSA-2g29-xq2m-qcrf",
  "modified": "2026-10-30T15:34:00Z",
  "published": "2026-10-18T18:32:02Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-98764"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/06ac8609d6d185ac18c1d6a6a8a9b99e398bd124"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/35ab269602e1f7c4c0fe6ea3477264bea77eced3"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/7811d8e26c77f8eea79e22d0d14c67ec0658b348"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/7ef0ad5f462fa95bc4c6647d097d7c0384245b9c"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/9cd072788c76595529eb38f42bf94d23852f8534"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/9d8761b3c133f6c6a6d3486839dac60e2cf4bfe3"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/c5f452e057df6ef89300523d13ad6833bfd199cd"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/e5b9d6bb2a8906a1188c9a90cc8d102de3f07cad"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}



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