{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2026-90022", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2026-09-11T19:38:34.781Z", "datePublished": "2026-09-16T10:33:26.238Z", "dateUpdated": "2026-10-19T08:56:35.790Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-10-19T08:56:35.790Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_midi2: fix use-after-free in string attribute show path\n\nf_midi2_opts_str_show() takes the string lock internally, but its\ncallers dereference the opts->info. pointer before calling it,\noutside the lock. This races with f_midi2_opts_str_store(), which\nfrees the old string under opts->lock when the attribute is written\nconcurrently, the show path can read a pointer that gets freed\nbefore the lock inside str_show() is even taken.\n\nChange f_midi2_opts_str_show() to take a pointer to the string field,\nmatching the existing pattern in f_midi2_opts_str_store(), and\ndereference it only after the lock is held. Update all three callers\n(iface_name, block name, and the EP string option macro) accordingly." } ], "metrics": [ { "cvssV3_1": { "version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH" }, "scenarios": [ { "lang": "en", "value": "AV:L - The UAF is reached by concurrent local read/write of midi2 configfs string attributes (iface_name, ep_name, product_id, block name) under /sys/kernel/config/usb_gadget//functions/midi2.*; no USB host packets, cable, or UDC bind are required, matching other gadget configfs bugs scored Local rather than Physical.\nAC:L - The attacker controls both sides by opening the same attribute on two fds (configfs serializes only per-fd) and racing show against store; store kfree()s the prior kstrndup string under opts->lock while show already holds the stale pointer, and the function need not be bound (store fails only if refcnt != 0).\nPR:L - gadgets_make(), function_make(), and the midi2 show/store handlers perform no capable() check; access is gated only by configfs DAC, and Android/embedded USB gadget HALs routinely chown /sys/kernel/config/usb_gadget to non-root system or daemon accounts.\nUI:N - The attacker creates the midi2 function instance and performs the concurrent attribute read/write themselves; configfs is typically already mounted at /sys/kernel/config, and no victim mount, cable plug, or other-user action is required.\nS:U - The use-after-free of the configfs kstrndup string corrupts kernel heap within the same host kernel security authority; this is not a VM escape, sandbox breakout, or IOMMU/DMA boundary bypass.\nC:H - Callers load opts->info. outside the lock, then f_midi2_opts_str_show() scnprintfs that pointer after a concurrent store kfree()d it; reclaiming the kmalloc object lets the attacker control the bytes copied to userspace, a UAF disclosure primitive.\nI:H - The same UAF of the kstrndup string, with store spraying attacker-chosen size and content into the same slab, is a classic heap use-after-free that can be converted into overlapping objects, arbitrary write, and control-flow hijack.\nA:H - scnprintf() of the freed string after kfree() reliably produces a KASAN slab-use-after-free oops or kernel panic, which the attacker can retrigger with further concurrent show/store loops." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/usb/gadget/function/f_midi2.c" ], "versions": [ { "version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1", "lessThan": "f9bdf4c4f6410a1dfafafa383a0e21069372657f", "status": "affected", "versionType": "git" }, { "version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1", "lessThan": "d11f3300b39e2daad2f0d9d66ddcc39a156cb594", "status": "affected", "versionType": "git" }, { "version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1", "lessThan": "e89e30f0b5d3004fe5955250bd8b04f3733e32ce", "status": "affected", "versionType": "git" }, { "version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1", "lessThan": "49fab5e1bdb205c36c965d0e9677bc40d282d3a2", "status": "affected", "versionType": "git" }, { "version": "29ee7a4dddd5caa18d1cef000f20c6af43f762f1", "lessThan": "fed0aa7c6eaedc6c0d4e362fc91724aa47be4a7b", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/usb/gadget/function/f_midi2.c" ], "versions": [ { "version": "6.6", "status": "affected" }, { "version": "0", "lessThan": "6.6", "status": "unaffected", "versionType": "semver" }, { "version": "6.6.157", "lessThanOrEqual": "6.6.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.12.110", "lessThanOrEqual": "6.12.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.18.51", "lessThanOrEqual": "6.18.*", "status": "unaffected", "versionType": "semver" }, { "version": "7.2.5", "lessThanOrEqual": "7.2.*", "status": "unaffected", "versionType": "semver" }, { "version": "7.3", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.6", "versionEndExcluding": "6.6.157" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.6", "versionEndExcluding": "6.12.110" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.6", "versionEndExcluding": "6.18.51" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.6", "versionEndExcluding": "7.2.5" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.6", "versionEndExcluding": "7.3" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/f9bdf4c4f6410a1dfafafa383a0e21069372657f" }, { "url": "https://git.kernel.org/stable/c/d11f3300b39e2daad2f0d9d66ddcc39a156cb594" }, { "url": "https://git.kernel.org/stable/c/e89e30f0b5d3004fe5955250bd8b04f3733e32ce" }, { "url": "https://git.kernel.org/stable/c/49fab5e1bdb205c36c965d0e9677bc40d282d3a2" }, { "url": "https://git.kernel.org/stable/c/fed0aa7c6eaedc6c0d4e362fc91724aa47be4a7b" } ], "title": "usb: gadget: f_midi2: fix use-after-free in string attribute show path", "x_generator": { "engine": "bippy-1.2.0" } } } }