ALSA: ump: do not touch legacy_rmidi before it exists
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ALSA: ump: do not touch legacy_rmidi before it exists
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.
From the CVE record · Linux
The Linux kernel’s ALSA UMP code can dereference a null legacy rawmidi pointer. This can happen if a UMP packet arrives after endpoint parsing but before the legacy rawmidi device is attached. The input does not specify how an attacker could trigger this condition or whether authentication or user interaction is required.
Engineers running the Linux kernel should check affected versions against the vendor advisory; no version range was provided.