CVE-2026-89735: usb: gadget: midi2: remove default configfs groups on teardown
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: midi2: remove default configfs groups on teardown
fmidi2allocinst() creates default configfs child groups for the default endpoint and default block using configfsadddefaultgroup(), setting their internal refcount to 1.
However, during function teardown in fmidi2freeinst() or EP cleanup in fmidi2epoptsrelease(), configfsremovedefaultgroups() is never called, therefore never dropping the refcount and leaking struct fmidi2epopts and fmidi2blockopts.
Add the missing configfsremovedefaultgroups() in the afformentioned functions to free the structs properly.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.113-1~deb12u1 - Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Configuration
Call configfs_remove_default_groups() in f_midi2_free_inst() and during endpoint cleanup in f_midi2_ep_opts_release() to drop the default-group references and free f_midi2_ep_opts and f_midi2_block_opts properly.
Linux kernel USB gadget midi2 configfs_remove_default_groups() = called during teardown
Event History
Frequently Asked Questions
How can I verify whether a kernel contains the fix?
Check whether the kernel source or history includes one of the referenced stable commits: 4beda67ee72e0c8df5b49951dd8b96f6adb25e02, a15c2acd3083461f91725760e59dff88b33c28f6, or 9ea5dfb2bfef4f8a7e704d1921d8a790cb7fb700. The provided data does not list affected or fixed kernel version ranges.
What is the operational impact of the missing cleanup?
Default configfs endpoint and block option structures remain referenced after MIDI2 function teardown or endpoint cleanup. This causes leaks of struct f_midi2_ep_opts and struct f_midi2_block_opts rather than freeing them properly.