UBUNTU-CVE-2026-90024: Medium severity ubuntu/linux-hwe-edge vulnerability
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: midi2: Fix null-pointer dereference in fmidi2freeepreqs A null-pointer dereference occurs in fmidi2freeepreqs() when attempting to clean up an endpoint that was never initialized. When configuring the MIDI 2.0 gadget via configfs and setting the block direction to SNDRVUMPDIRINPUT, the initialization of the midi1epout endpoint is explicitly skipped during the gadget bind phase (fmidi2bind()). As a result, the usbep->card field remains NULL. Later, when the host sets the alternate setting, fmidi2setalt() unconditionally stops both the IN and OUT endpoints by calling fmidi2stopeps(), which in turn calls fmidi2freeepreqs() for both endpoints. When fmidi2freeepreqs() is called for the uninitialized midi1epout, it attempts to dereference usbep->card to determine the number of requests to free, leading to a crash. Fix this by using usbep->numreqs instead of usbep->card->info.numreqs in fmidi2freeepreqs(). usbep->numreqs is correctly set during fmidi2initep() and remains 0 if the endpoint was never initialized, safely avoiding the loop. For consistency, apply the same change to fmidi2allocepreqs(). Oops: general protection fault, probably for non-canonical address 0xdffffc00000000ee: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000770-0x0000000000000777] ... RIP: 0010:fmidi2freeepreqs drivers/usb/gadget/function/fmidi2.c:1166 [inline] RIP: 0010:fmidi2stopeps+0x28e/0x4d0 drivers/usb/gadget/function/fmidi2.c:1246 ... Call Trace: <TASK> fmidi2setalt+0x11c/0xf00 drivers/usb/gadget/function/fmidi2.c:1296 compositesetup+0x1ffd/0x3480 drivers/usb/gadget/composite.c:1933 configfscompositesetup+0xbd/0x100 drivers/usb/gadget/configfs.c:1877
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- 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 - Compensating control
In the Linux kernel USB MIDI 2.0 gadget driver, change f_midi2_free_ep_reqs() to use usb_ep->num_reqs instead of usb_ep->card->info.num_reqs, and apply the same change to f_midi2_alloc_ep_reqs().
Event History
Frequently Asked Questions
Which deployments are exposed to this crash condition?
Systems using the Linux USB MIDI 2.0 gadget configured through configfs with the block direction set to SNDRV_UMP_DIR_INPUT are exposed. The affected software listings include Ubuntu linux-riscv, linux-realtime, linux-azure, linux-gcp, linux-azure-fde, linux-gke, linux-hwe-edge, and linux-gkeop.
What interaction is needed to trigger the issue?
An attacker or connected USB host must cause the gadget host-side alternate-setting handling to run after the MIDI 2.0 gadget has been configured with input-only block direction. That path attempts cleanup for an OUT endpoint that was not initialized, causing a null-pointer dereference.
What can be done if an updated kernel cannot be deployed immediately?
Avoid configuring the MIDI 2.0 gadget through configfs with its block direction set to SNDRV_UMP_DIR_INPUT. Limiting connection to untrusted USB hosts also reduces the opportunity for a host to trigger the affected alternate-setting path.