Re: [PATCH] ALSA: ump: do not touch legacy_rmidi before it exists
From: Takashi Iwai
Date: Wed Sep 02 2026 - 05:19:06 EST
On Wed, 02 Sep 2026 09:39:18 +0200,
Qingyu Zhang wrote:
>
> snd_ump_parse_endpoint() sets ump->parsed on every exit, including
> error, before the caller attaches the legacy rawmidi device.
> ump_handle_ep_name_msg() then treats parsed as "legacy_rmidi is live"
> and calls ump_legacy_set_rawmidi_name(), which snprintf()s into
> ump->legacy_rmidi->name. If a UMP packet arrives in that window
> (IRQ path from snd_ump_receive), legacy_rmidi is still NULL
> (KASAN null-ptr-deref in snprintf).
>
> Guard the legacy helpers. parsed only means endpoint info was
> parsed, not that legacy_rmidi exists.
>
> Fixes: 37e0e14128e0 ("ALSA: ump: Support UMP Endpoint and Function Block parsing")
> Signed-off-by: Qingyu Zhang <usupergate@xxxxxxxxx>
Applied now. Thanks.
Takashi