usb: gadget: f_midi2: fix use-after-free in string attribute show path
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_midi2: fix use-after-free in string attribute show path f_midi2_opts_str_show() takes the string lock internally, but its callers dereference the opts->info. pointer before calling it, outside the lock. This races with f_midi2_opts_str_store(), 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 str_show() is even taken. Change f_midi2_opts_str_show() to take a pointer to the string field, matching the existing pattern in f_midi2_opts_str_store(), and dereference it only after the lock is held. Update all three callers (iface_name, block name, and the EP string option macro) accordingly.
CVE-2026-90022
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-90022
Linux
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Linux
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1",
"lessThan": "f9bdf4c4f6410a1dfafafa383a0e21069372657f",
"versionType": "git"
},
{
"status": "affected",
"version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1",
"lessThan": "d11f3300b39e2daad2f0d9d66ddcc39a156cb594",
"versionType": "git"
},
{
"status": "affected",
"version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1",
"lessThan": "e89e30f0b5d3004fe5955250bd8b04f3733e32ce",
"versionType": "git"
},
{
"status": "affected",
"version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1",
"lessThan": "49fab5e1bdb205c36c965d0e9677bc40d282d3a2",
"versionType": "git"
},
{
"status": "affected",
"version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1",
"lessThan": "fed0aa7c6eaedc6c0d4e362fc91724aa47be4a7b",
"versionType": "git"
}
],
"programFiles": [
"drivers/usb/gadget/function/f_midi2.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "6.6"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "6.6",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "6.6.157",
"versionType": "semver",
"lessThanOrEqual": "6.6.*"
},
{
"status": "unaffected",
"version": "6.12.110",
"versionType": "semver",
"lessThanOrEqual": "6.12.*"
},
{
"status": "unaffected",
"version": "6.18.51",
"versionType": "semver",
"lessThanOrEqual": "6.18.*"
},
{
"status": "unaffected",
"version": "7.2.5",
"versionType": "semver",
"lessThanOrEqual": "7.2.*"
},
{
"status": "unaffected",
"version": "7.3",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"drivers/usb/gadget/function/f_midi2.c"
],
"defaultStatus": "affected"
}
]- Related CVEs
- CVE-2026-90022
Source reference:
/cveMetadata/cveId
Publisher severity
high
Source reference: /containers/cna/metrics
- Event
- #36452 · Revision 1
- Added to Heist Feed
- Publisher date