Skip to main content
Vulnerability Database/CVE-2026-98764

CVE-2026-98764: Linux Kernel Buffer Overflow Vulnerability

CVE-2026-98764 is a buffer overflow flaw in the Linux kernel USB gadget FunctionFS driver that causes NULL pointer dereference when querying endpoint descriptors at higher speeds without proper fallback handling. This article covers the technical details, affected kernel versions, security impact, and available mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98764 Overview

CVE-2026-98764 is a NULL pointer dereference vulnerability in the Linux kernel's USB gadget FunctionFS (f_fs) subsystem. The flaw occurs when user space configures FunctionFS with only full-speed descriptors while the gadget operates at a higher USB speed. A subsequent FUNCTIONFS_ENDPOINT_DESC ioctl call selects a descriptor index based on the gadget speed without checking whether the descriptor exists. Dereferencing the resulting NULL pointer triggers an immediate kernel panic, resulting in a local denial-of-service condition against any system exposing FunctionFS to unprivileged user space.

Critical Impact

Local user space can trigger a kernel NULL pointer dereference panic through the FunctionFS ioctl interface, causing a denial of service on affected Linux systems.

Affected Products

  • Linux kernel USB gadget subsystem (drivers/usb/gadget/function/f_fs.c)
  • Linux distributions shipping the vulnerable f_fs FunctionFS implementation
  • Embedded and mobile systems using USB gadget mode with FunctionFS

Discovery Timeline

  • 2026-10-18 - CVE-2026-98764 published to NVD
  • 2026-10-21 - Last updated in NVD database

Technical Details for CVE-2026-98764

Vulnerability Analysis

The vulnerability resides in ffs_epfile_ioctl() within the FunctionFS driver. When user space issues the FUNCTIONFS_ENDPOINT_DESC ioctl, the handler selects a descriptor from epfile->ep->descs[] using an index derived strictly from gadget->speed. The function assigns index 2 for SuperSpeed and SuperSpeed Plus, index 1 for High-Speed, and index 0 for all other speeds. The handler then dereferences desc->bLength via a memcpy call without verifying that the descriptor pointer is valid.

Because config_ep_by_speed() already contains fallback logic that silently downgrades to full-speed descriptors when higher-speed descriptors are missing, usb_ep_enable() succeeds and epfile->ep becomes valid. However, the descs[] array entries for unsupplied speeds remain NULL. The mismatch between enablement logic and ioctl descriptor selection creates the dereference condition.

Root Cause

The root cause is missing validation in the descriptor-selection path of ffs_epfile_ioctl(). The handler trusts the gadget speed as an authoritative index into epfile->ep->descs[] instead of verifying that the targeted descriptor was supplied by user space. This represents a NULL Pointer Dereference weakness in kernel ioctl input handling.

Attack Vector

A local user with access to the FunctionFS mount point can trigger the panic by writing a descriptor set containing only full-speed descriptors (for example, with flags = FUNCTIONFS_HAS_FS_DESC), then issuing the FUNCTIONFS_ENDPOINT_DESC ioctl while the gadget operates at USB_SPEED_HIGH, USB_SPEED_SUPER, or USB_SPEED_SUPER_PLUS. The resulting kernel panic halts the system. No synthetic proof-of-concept code is published alongside the fix; the upstream commit messages describe the trigger path in prose.

Detection Methods for CVE-2026-98764

Indicators of Compromise

  • Unexpected kernel panics referencing ffs_epfile_ioctl or f_fs in crash logs or kdump output.
  • Warning messages from config_ep_by_speed() indicating fallback to full-speed descriptors preceding a crash.
  • Unprivileged processes repeatedly opening FunctionFS endpoint files and issuing FUNCTIONFS_ENDPOINT_DESC ioctls.

Detection Strategies

  • Monitor kernel ring buffer entries (dmesg) for NULL pointer dereference oops traces originating in USB gadget code paths.
  • Audit systems that mount functionfs and enumerate processes with open file descriptors against those mount points.
  • Track installed kernel versions against the fixed commits referenced in the upstream stable tree.

Monitoring Recommendations

  • Centralize kernel crash telemetry and alert on panics containing f_fs, ffs_epfile_ioctl, or FUNCTIONFS_ENDPOINT_DESC symbols.
  • Watch for repeated USB gadget reinitialization events on embedded or mobile fleet devices.
  • Correlate kernel oops events with the identity of the user namespace or container that triggered the ioctl.

How to Mitigate CVE-2026-98764

Immediate Actions Required

  • Apply the upstream kernel patches that add descriptor fallback logic to ffs_epfile_ioctl().
  • Restrict access to FunctionFS mount points to trusted system components only.
  • Audit container and sandbox configurations to ensure unprivileged workloads cannot mount or interact with functionfs.

Patch Information

The fix adds fallback through lower-speed descriptors when the descriptor for the current speed was not supplied, mirroring the behavior of config_ep_by_speed(). If no speed-specific descriptor exists, the handler falls back to epfile->ep->ep->desc (the active descriptor) and safely returns -EINVAL when no valid descriptor is found. The patch also marks desc as const to align with struct usb_ep::desc. The fix is distributed across the following upstream commits: 06ac8609d6d1, 35ab269602e1, 7811d8e26c77, 9cd072788c76, and 9d8761b3c133.

Workarounds

  • Disable the FunctionFS gadget function on systems that do not require USB gadget mode.
  • Ensure user space tooling always supplies descriptors for every USB speed the gadget may negotiate, including High-Speed and SuperSpeed variants.
  • Limit which users and containers can access the FunctionFS mount via filesystem permissions and mount namespace isolation.
bash
# Verify running kernel version and check for FunctionFS usage
uname -r
mount | grep functionfs
lsmod | grep -E 'libcomposite|usb_f_fs'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.