UBUNTU-CVE-2026-89736: Use After Free
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: uaudio: Fix use-after-free on sound card disconnect gaudiocleanup() invokes sndcardfreewhenclosed() to initiate sound card teardown and immediately frees the underlying struct snduacchip context. However, sndcardfreewhenclosed() returns asynchronously while ALSA control elements (kctls) remain open in userspace. When userspace control applications access or close these open file descriptors, kctl callbacks attempt to dereference kctl->privatedata pointing to &uac->cprm or &uac->pprm within the freed uac structure, resulting in a use-after-free (UAF) memory corruption. Fix this issue by deferring the destruction of struct snduacchip until all references to the ALSA sound card are released. Register a custom card->privatefree callback (uaudiocardfree) during gaudiosetup() that frees uac and its associated playback/capture request and ring buffers only when the sound card reference count drops to zero.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Defer freeing struct snd_uac_chip until the ALSA sound card reference count reaches zero: register u_audio_card_free as card->private_free during g_audio_setup(), and have it free uac together with its playback/capture requests and ring buffers after snd_card_free_when_closed() completes.