CVE-2026-74387: ALSA: seq: midi: Serialize output teardown with event_input

Published Aug 15, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

ALSA: seq: midi: Serialize output teardown with eventinput

eventprocessmidi() borrows msynth->outputrfile.output and then passes the substream to dumpmidi() and sndrawmidikernelwrite() without synchronizing with the output open/close transition. midisynthuse() also publishes outputrfile before sndrawmidioutputparams() has finished.

The last midisynthunuse() can therefore release the same rawmidi file and free substream->runtime before sndrawmidikernelwrite1() takes its runtime buffer reference. That leaves the eventinput path using a stale substream or runtime and can end in a NULL-deref or use-after-free.

Fix this with two pieces of synchronization. Keep a short IRQ-safe spinlock only for publishing or clearing outputrfile and for pairing the output snapshot with an snduselockt reference. Once eventprocessmidi() has taken that in-flight reference, it drops the spinlock before calling sndseqdumpvarevent(), dumpmidi(), or sndrawmidikernelwrite(). midisynthunuse() now detaches the visible rawmidi file under the same spinlock, waits for the in-flight writers to drain, and only then drains and releases the saved file. midisynthuse() likewise opens into a local sndrawmidifile and publishes it only after sndrawmidioutputparams() succeeds.

The buggy scenario involves two paths, with each column showing the order within that path:

eventinput path: last unuse path: 1. eventprocessmidi() snapshots 1. midisynthunuse() starts outputrfile.output. tearing down outputrfile. 2. dumpmidi() reaches 2. sndrawmidikernelrelease() sndrawmidikernelwrite() closes the output file. before runtime is pinned. 3. closesubstream() frees 3. The callback keeps using substream->runtime. the borrowed substream.

Validation reproduced this kernel report: KASAN null-ptr-deref in sndrawmidikernelwrite1+0x56/0x360 RIP: 0033:0x7fde7dd0837f RIP: 0010:sndrawmidikernelwrite1+0x56/0x360

Event History

Aug 15, 2026
CVE Published
via MITRE·05:59 AM
Data Sourced
via MITRE·05:59 AM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203