{"id":7340,"date":"2026-09-04T18:49:30","date_gmt":"2026-09-04T10:49:30","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-74387"},"modified":"2026-09-04T18:49:30","modified_gmt":"2026-09-04T10:49:30","slug":"cve-2026-74387","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-74387","title":{"rendered":"CVE-2026-74387 [HIGH] &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: seq: midi: Seri"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>ALSA: seq: midi: Serialize output teardown with event_input<\/p>\n<p>event_process_midi() borrows msynth-&gt;output_rfile.output and then<br \/>\npasses the substream to dump_midi() and snd_rawmidi_kernel_write()<br \/>\nwithout synchronizing with the output open\/close transition.<br \/>\nmidisynth_use() also publishes output_rfile before<br \/>\nsnd_rawmidi_output_params() has finished.<\/p>\n<p>The last midisynth_unuse() can therefore release the same rawmidi file<br \/>\nand free substream-&gt;runtime before snd_rawmidi_kernel_write1() takes<br \/>\nits runtime buffer reference. That leaves the event_input path using a<br \/>\nstale substream or runtime and can end in a NULL-deref or use-after-free.<\/p>\n<p>Fix this with two pieces of synchronization. Keep a short IRQ-safe<br \/>\nspinlock only for publishing or clearing output_rfile and for pairing<br \/>\nthe output snapshot with an snd_use_lock_t reference. Once<br \/>\nevent_process_midi() has taken that in-flight reference, it drops the<br \/>\nspinlock before calling snd_seq_dump_var_event(), dump_midi(), or<br \/>\nsnd_rawmidi_kernel_write(). midisynth_unuse() now detaches the visible<br \/>\nrawmidi file under the same spinlock, waits for the in-flight writers<br \/>\nto drain, and only then drains and releases the saved file.<br \/>\nmidisynth_use() likewise opens into a local snd_rawmidi_file and<br \/>\npublishes it only after snd_rawmidi_output_params() succeeds.<\/p>\n<p>The buggy scenario involves two paths, with each column showing the<br \/>\norder within that path:<\/p>\n<p>event_input path:                     last unuse path:<br \/>\n1. event_process_midi() snapshots    1. midisynth_unuse() starts<br \/>\n   output_rfile.output.                 tearing down output_rfile.<br \/>\n2. dump_midi() reaches               2. snd_rawmidi_kernel_release()<br \/>\n   snd_rawmidi_kernel_write()           closes the output file.<br \/>\n   before runtime is pinned.         3. close_substream() frees<br \/>\n3. The callback keeps using             substream-&gt;runtime.<br \/>\n   the borrowed substream.<\/p>\n<p>Validation reproduced this kernel report:<br \/>\nKASAN null-ptr-deref in snd_rawmidi_kernel_write1+0x56\/0x360<br \/>\nRIP: 0033:0x7fde7dd0837f<br \/>\nRIP: 0010:snd_rawmidi_kernel_write1+0x56\/0x360<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>ALSA: seq: midi: Serialize output teardown with event_input<\/p>\n<p>event_process_midi() borrows msynth-&gt;output_rfile.output and then<br \/>\npass<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-7340","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/7340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}