CVE-2026-90022: usb: gadget: f_midi2: fix use-after-free in string attribute show path

Published Sep 16, 2026
·
Updated

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

usb: gadget: fmidi2: fix use-after-free in string attribute show path

fmidi2optsstrshow() takes the string lock internally, but its callers dereference the opts->info.<field> pointer before calling it, outside the lock. This races with fmidi2optsstrstore(), which frees the old string under opts->lock when the attribute is written concurrently, the show path can read a pointer that gets freed before the lock inside strshow() is even taken.

Change fmidi2optsstrshow() to take a pointer to the string field, matching the existing pattern in fmidi2optsstrstore(), and dereference it only after the lock is held. Update all three callers (ifacename, block name, and the EP string option macro) accordingly.

Affected Software

1 affected component
Linux Kernel

Event History

Sep 16, 2026
CVE Published
via MITRE·10:33 AM
Data Sourced
via MITRE·10:33 AM
Description

Frequently Asked Questions

1

What conditions are required to trigger the use-after-free?

The affected f_midi2 string attribute must be read while the same string option is concurrently written. The race occurs because the read path can dereference the existing string pointer before acquiring the lock, while the write path frees the old string under that lock.

2

Which configuration attributes are involved?

The fix updates the show-path callers for the iface_name and block name attributes, as well as the endpoint string option handled through the EP string option macro.

3

How can I determine whether a kernel contains the fix?

Check whether the f_midi2 string show helper was changed to receive a pointer to the string field and dereference it only after taking opts->lock. The linked stable commits provide the corresponding fixes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203