CVE-2026-98770: usb: gadget: midi2: Fix the jack descriptor array sizes
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: midi2: Fix the jack descriptor array sizes
The jack in/out descriptor arrays in struct f_midi2_usb_config have the size of MAX_CABLES, which look reasonable -- but it turned out to be incorrect. Namely, the entries for those arrays are added from both inputs and outputs, hence for each loop cycle, it adds two, ended up with as twice as the expected size. This inconsistency may result in potential OOB when a large number of jacks are set up via configfs, although the max number of cables (the loop count) is limited to MAX_CABLES.
For addressing it, correct the jack_ins & jack_outs array sizes to twice, MAX_CABLES * 2.
The Linux kernel CVE team has assigned CVE-2026-98770 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.6 with commit 856fa444b0982746f95e801bab0e586533eb29a3 and fixed in 6.12.113 with commit 8294ff75a9de23f7cc641e5e5ca31fa6ea72a574 Issue introduced in 6.6 with commit 856fa444b0982746f95e801bab0e586533eb29a3 and fixed in 6.18.56 with commit 87f2185423e01f113811301878f2f67eccec960d Issue introduced in 6.6 with commit 856fa444b0982746f95e801bab0e586533eb29a3 and fixed in 7.2.10 with commit 223c3bd02a582776d8ee47dae7b69d3258420694 Issue introduced in 6.6 with commit 856fa444b0982746f95e801bab0e586533eb29a3 and fixed in 7.3-rc6 with commit 310c2d4608d8c1a2baa57db1dfd319c5c40cf4a1
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98770
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/usb/gadget/function/f_midi2.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/8294ff75a9de23f7cc641e5e5ca31fa6ea72a574 https://git.kernel.org/stable/c/87f2185423e01f113811301878f2f67eccec960d https://git.kernel.org/stable/c/223c3bd02a582776d8ee47dae7b69d3258420694 https://git.kernel.org/stable/c/310c2d4608d8c1a2baa57db1dfd319c5c40cf4a1