Cloudanix VulnDB

CVE-2026-89732

None

CVSS

—

EPSS

0.2%

Published

Sep 11, 2026

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in the Linux kernel's USB gadget handling can cause the system to freeze when a program reads from a USB device at the same time the device is being disconnected.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Race Condition
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw allows a deadlock in f_fs_ep0_read when the function holds ffs->mutex while sleeping via wait_event_interruptible_exclusive_locked_irq; concurrent configfs teardown (functionfs_unbind) blocks on the same mutex, leaving the kernel unable to complete gadget unbind or further ep0 operations.

Why it matters to the business

USB gadget devices become unresponsive, causing loss of USB-based connectivity, storage, or networking functions on affected Linux systems and embedded devices until the system is rebooted.

How an attack unfolds

An attacker with local access configures a USB gadget via configfs, starts a userspace daemon that repeatedly reads from ep0, then triggers asynchronous teardown of the gadget; the resulting mutex contention produces a permanent deadlock between the configfs teardown thread and the userspace read loop.

How to fix it

Upgrade to a Linux kernel release containing the fix that drops ffs->mutex before the wait and switches to wait_event_interruptible_exclusive; rebuild and deploy the updated kernel on all affected systems.

How to confirm the fix worked

Confirm the kernel source contains the corrected ffs_ep0_read logic that releases the mutex prior to sleeping and re-acquires it after wakeup at the retry label; test by exercising concurrent ep0 reads and configfs unbind without deadlock.

Typical attack path

  1. Configure and bind a USB gadget function that uses f_fs
  2. Launch a userspace process that performs repeated read() calls on ep0
  3. Trigger gadget teardown via configfs (e.g., writing empty string to UDC)
  4. Observe kernel deadlock preventing further gadget operations or system responsiveness

How to detect it

Examine kernel logs (dmesg, /var/log/kern.log) for hung-task warnings or mutex contention involving f_fs or functionfs_unbind; look for processes stuck in uninterruptible sleep while holding ffs mutex during USB gadget teardown events.

What your security team should do

  • Apply the upstream kernel patch or distribution update that resolves the mutex ordering issue
  • Audit any custom USB gadget userspace daemons for repeated ep0 polling patterns
  • Monitor kernel logs for USB gadget unbind failures or hung tasks after gadget reconfiguration

The record

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_fs: Prevent deadlock during ep0 read loop Currently, ffs_ep0_read() holds ffs->mutex when it prepares to go to sleep waiting for an event. When no setup events are pending, it calls wait_event_interruptible_exclusive_locked_irq() with the mutex still held. The wait macro deliberately drops the waitqueue spinlock before sleeping but does not drop the mutex. If a userspace daemon is polling ep0 via read() and the gadget is asynchronously torn down via configfs (e.g., echo "" > UDC), a deadlock can occur: 1. The configfs teardown calls functionfs_unbind(), which queues a FUNCTIONFS_UNBIND event. 2. The daemon wakes up, consumes the event, and drops the mutex. 3. However, if the daemon loops and immediately issues another read() before exiting, it reacquires ffs->mutex and again goes into an interruptible sleep. 4. Meanwhile, functionfs_unbind() continues execution and attempts to acquire ffs->mutex to tear down ep0req. 5. The kernel deadlocks because the configfs thread is stuck in an uninterruptible sleep waiting for the mutex, while the userspace daemon is in an interruptible sleep holding the mutex forever because no more events will arrive. To fix this, we drop both the waitqueue spinlock and ffs->mutex before going to sleep, and use wait_event_interruptible_exclusive() instead. Upon waking up, we jump back to the `retry` label to safely reacquire the mutex and re-evaluate the state machine. By not sleeping with ffs->mutex held, we natively decouple gadget teardowns (which require the mutex) from userspace polling.

Affected packages

Ecosystem Package Introduced Fixed