linux/sound/firewire/fireworks
Greg Kroah-Hartman 07704bbf36 ALSA: fireworks: bound device-supplied status before string array lookup
The status field in an EFW response is a 32-bit value supplied by the
firewire device.  efr_status_names[] has 17 entries so a status value
outside that range goes off into the weeds when looking at the %s value.

Even worse, the status could return EFR_STATUS_INCOMPLETE which is
0x80000000, and is obviously not in that array of potential strings.

Fix this up by properly bounding the index against the array size and
printing "unknown" if it's not recognized.

Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Fixes: bde8a8f23b ("ALSA: fireworks: Add transaction and some commands")
Cc: stable <stable@kernel.org>
Assisted-by: gregkh_clanker_t1000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/2026040953-astute-camera-1aa1@gregkh
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-04-10 14:59:47 +02:00
..
fireworks_command.c ALSA: fireworks: bound device-supplied status before string array lookup 2026-04-10 14:59:47 +02:00
fireworks_hwdep.c ALSA: firewire: fireworks: Use guard() for spin locks 2025-08-30 10:02:22 +02:00
fireworks_midi.c ALSA: firewire: fireworks: Use guard() for spin locks 2025-08-30 10:02:22 +02:00
fireworks_pcm.c ALSA: firewire: fireworks: Use guard() for mutex locks 2025-08-30 10:02:21 +02:00
fireworks_proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fireworks_stream.c ALSA: firewire: fireworks: Use guard() for spin locks 2025-08-30 10:02:22 +02:00
fireworks_transaction.c ALSA: firewire: fireworks: Use guard() for spin locks 2025-08-30 10:02:22 +02:00
fireworks.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fireworks.h ALSA: fireworks: fulfil device entries 2021-06-12 09:33:09 +02:00
Makefile ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00