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

CVE-2026-98769: Linux Kernel USB Gadget Buffer Overflow

CVE-2026-98769 is a buffer overflow flaw in the Linux kernel USB gadget f_uac1_legacy driver that allows malicious USB hosts to write out-of-bounds. This post covers technical details, affected versions, and mitigation.

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-98769 Overview

CVE-2026-98769 is an out-of-bounds read/write vulnerability in the Linux kernel's USB gadget subsystem, specifically within the f_uac1_legacy audio function driver. The generic_set_cmd() and generic_get_cmd() functions extract the low nibble of ctrl->bRequest and use it as an index into con->data[], a 5-element array declared in struct usb_audio_control. Index values of 5 through 15 write or read up to 44 bytes past the array boundary on the heap. A malicious USB host can trigger the condition by sending a crafted class-specific SET_CUR or GET_CUR request, invoking the flaw from an IRQ completion handler with no additional preconditions.

Critical Impact

A malicious USB host can corrupt adjacent heap memory on any Linux system exposing the UAC1 legacy gadget, enabling potential denial of service or memory disclosure.

Affected Products

  • Linux kernel versions containing the f_uac1_legacy USB gadget driver prior to the fix commits
  • Systems configured as USB device/gadget with the UAC1 legacy audio function
  • Embedded Linux platforms and development boards acting as USB audio peripherals

Discovery Timeline

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

Technical Details for CVE-2026-98769

Vulnerability Analysis

The f_uac1_legacy driver implements the USB Audio Class 1.0 legacy gadget function. When a USB host issues a class-specific control request, the gadget dispatches it to generic_set_cmd() or generic_get_cmd(). Both helpers derive a command index with u8 cmd = (ctrl->bRequest & 0x0F), yielding values from 0 to 15. The target buffer con->data[] is defined as a 5-element array in include/linux/usb/audio.h, so any index of 5 or greater accesses memory outside the structure.

The write path (con->data[cmd] = value) corrupts heap memory adjacent to the usb_audio_control allocation. The read path leaks adjacent heap bytes into the response buffer returned to the USB host. Because the dispatch runs inside an IRQ completion handler, no authentication or prior interaction is required beyond physical USB connection.

Root Cause

The root cause is missing bounds validation on an attacker-controlled index [CWE-787 / CWE-125]. The code masks bRequest to four bits but never verifies that the result falls within ARRAY_SIZE(con->data). The upstream patches add an explicit ARRAY_SIZE() guard in both generic_set_cmd() and generic_get_cmd() so out-of-range requests are rejected before indexing the array.

Attack Vector

Exploitation requires a USB host capable of issuing arbitrary class-specific control transfers to a Linux target configured as a UAC1 legacy audio gadget. Typical scenarios include development boards, phones, or embedded devices in USB device mode connected to a hostile host. The attacker crafts a SET_CUR control request with bRequest low-nibble values between 5 and 15 to trigger an out-of-bounds write, or a matching GET_CUR request to produce an out-of-bounds read. The IRQ-driven dispatch path processes the request without further validation.

See the upstream fix commits for the exact code change: Kernel Git Commit 36f3f00 and Kernel Git Commit da841c15.

Detection Methods for CVE-2026-98769

Indicators of Compromise

  • Unexpected kernel crashes, slab corruption warnings, or KASAN reports referencing generic_set_cmd or generic_get_cmd in f_uac1_legacy.c
  • USB gadget devices receiving class-specific control transfers with bRequest low nibble values greater than 4
  • Anomalous USB host enumeration or control traffic directed at UAC1 audio gadget endpoints

Detection Strategies

  • Enable KASAN (Kernel Address Sanitizer) on test and staging kernels to catch out-of-bounds access in con->data[] during USB fuzzing
  • Review loaded kernel modules for g_audio or f_uac1_legacy on devices operating in gadget mode
  • Correlate dmesg entries containing slab or heap corruption with USB connection events

Monitoring Recommendations

  • Collect kernel ring buffer logs centrally and alert on BUG:, WARNING:, or KASAN entries referencing USB gadget audio functions
  • Monitor physical USB port activity on production embedded Linux fleets where UAC1 gadget mode is enabled
  • Track kernel version inventory to confirm patched builds are deployed across all affected devices

How to Mitigate CVE-2026-98769

Immediate Actions Required

  • Apply the upstream stable kernel updates that add the ARRAY_SIZE() guard to generic_set_cmd() and generic_get_cmd()
  • Audit systems configured in USB gadget mode and disable the f_uac1_legacy function where it is not required
  • Restrict physical USB access on devices that must expose the UAC1 legacy gadget

Patch Information

The fix validates the derived command index against ARRAY_SIZE(con->data) before using it. Patched commits are available in the stable tree: Kernel Git Commit 36f3f00, Kernel Git Commit 697cfe6, Kernel Git Commit 8c61187, Kernel Git Commit 9062d50, and Kernel Git Commit da841c15. Rebuild and redeploy kernels incorporating one of these commits for the relevant stable branch.

Workarounds

  • Unload the g_audio or equivalent gadget module when UAC1 legacy audio is not actively required
  • Switch the device out of USB gadget mode or disable USB OTG where feasible
  • Enforce physical port control, cable locks, or USB data blockers on exposed embedded systems until patches are deployed
bash
# Disable the UAC1 legacy gadget function via configfs on affected systems
rmmod g_audio 2>/dev/null
echo "" > /sys/kernel/config/usb_gadget/g1/UDC
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/f_uac1_legacy.0
rmdir /sys/kernel/config/usb_gadget/g1/functions/uac1_legacy.0

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.