CVE-2026-89735 in Linuxinfo

Summary

by MITRE • 09/11/2026

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

usb: gadget: midi2: remove default configfs groups on teardown

f_midi2_alloc_inst() creates default configfs child groups for the default endpoint and default block using configfs_add_default_group(), setting their internal refcount to 1.

However, during function teardown in f_midi2_free_inst() or EP cleanup in f_midi2_ep_opts_release(), configfs_remove_default_groups() is never called, therefore never dropping the refcount and leaking struct f_midi2_ep_opts and f_midi2_block_opts.

Add the missing configfs_remove_default_groups() in the afformentioned functions to free the structs properly.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 09/11/2026

The Linux kernel USB gadget subsystem contains a resource management flaw within the MIDI 2 function driver, specifically involving improper cleanup of configuration filesystem objects during instance teardown or endpoint option release. This vulnerability arises from an asymmetry between object creation and destruction in the f_midi2_alloc_inst() and related functions. When the midi2 function is initialized, it invokes configfs_add_default_group to create default child groups for both the primary endpoint and the associated block structure. These operations increment internal reference counts within the kernel's configuration filesystem subsystem, effectively pinning these data structures in memory to ensure they remain valid while potentially referenced by other components or userspace interfaces.

The critical technical flaw lies in the corresponding cleanup routines, namely f_midi2_free_inst() for general instance teardown and f_midi2_ep_opts_release() for endpoint-specific resource release. In both scenarios, the code fails to invoke configfs_remove_default_groups(). This omission means that while the driver attempts to free associated memory structures such as struct f_midi2_ep_opts and struct f_midi2_block_opts, it neglects to decrement the reference counts held by the configuration filesystem layer. Consequently, these objects are never fully released from the kernel's perspective, leading to a persistent state where allocated resources remain locked even after the driver has logically detached or stopped using them.

This oversight results in a classic memory leak within the Linux kernel space. Each time a midi2 gadget instance is created and subsequently destroyed, or when endpoint options are reconfigured, small amounts of kernel heap memory become permanently unreclaimable until system reboot. While individual leaks may appear negligible due to their size, repeated instantiation cycles can accumulate significant memory pressure over time. In long-running embedded systems or servers that frequently toggle USB gadget configurations, this behavior degrades overall system stability and performance by gradually consuming available kernel memory resources without providing any functional benefit.

From a classification standpoint, this issue aligns with CWE-401, which describes the failure to release allocated memory after it has been used. The vulnerability represents an improper resource cleanup mechanism where lifecycle management is incomplete. It does not currently allow for remote code execution or privilege escalation but poses a risk of denial-of-service through resource exhaustion if exploited in high-frequency scenarios. Security analysts should monitor this as a reliability and stability issue rather than a direct security breach, although persistent memory leaks can indirectly facilitate other attack vectors by destabilizing the host environment.

To mitigate this vulnerability, it is essential to ensure that every allocation performed via configfs_add_default_group() has a corresponding deallocation call in all exit paths of the driver logic. The fix involves inserting calls to configfs_remove_default_groups() within f_midi2_free_inst() and f_midi2_ep_opts_release(). This ensures that reference counts are properly decremented, allowing the kernel memory manager to reclaim the associated structs. Developers maintaining USB gadget drivers should audit their teardown sequences for similar asymmetries in configuration filesystem handling or other subsystem resource allocations to prevent recurrence of such leaks across different peripheral functions.

Responsible

Linux

Reservation

09/11/2026

Disclosure

09/11/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!