PT-2026-163457
CVE-2026-139416
·
Published
2026-11-30
·
Updated
2026-11-30
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
ALSA: rawmidi: Drain input work before freeing the runtime
The input runtime embeds event work, so the work must be drained before
close substream() frees the runtime. The cancellation in
snd rawmidi input trigger() runs before close clears substream->opened,
leaving a window for snd rawmidi receive() to enqueue more work.
With a sequencer subscription to a USB MIDI input port, an in-flight
completion can overlap the last subscription's midisynth unsubscribe():
- snd usbmidi input data() observes input triggered and is delayed before calling snd rawmidi receive().
- Unsubscribe enters close substream(), clears input triggered through the provider trigger callback and returns from cancel work sync(). The substream is still opened.
- The completion resumes. snd rawmidi receive() takes substream->lock, sees opened set and queues runtime->event work before dropping the lock.
- Close clears opened under that lock, closes the provider and frees the runtime. Stopping USB URBs does not drain the raw-MIDI work.
- The queued work runs and snd rawmidi input event work() reads event or substream from the freed runtime, causing a use-after-free.
Cancel input event work again after clearing opened, before closing the
provider or releasing the runtime's private data. Receive holds
substream->lock through its opened check and work enqueue, so once close
has cleared opened under that lock, no further receive can queue work.
The final cancellation therefore drains any late work before the
runtime is freed. Keep it outside the spinlock so a running callback can
finish.
Found an issue in the description? Have something to add? Feel free to write us 👾