From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2BC223E356; Fri, 24 Apr 2026 13:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037806; cv=none; b=iR6MyJ5DooNOW/zWenrx3hwTqQLiFq0Y/456gcguDLHC4wB844hGa9CFERykJ0/iUbFsFrWCB0MX9fBUX5A+eXOMuzKMSirLmFQIGwWe/oU6KpH6rn52/+GfG0zHe1vhEba8MRubk30LCPfPXssTp0GMCJBJlp0m1C7rsVA38h8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037806; c=relaxed/simple; bh=W/DIn1G3lN4FeCsbrh0NiRUSGSJoLU0UB+W6qZVKdW0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k8cpbSqSG3XTB6SXpufF9N8tXHxyRd5jkNenp0NdPx/Twr/rPc9S38+Y1THh5q32q6Eau9Rli+s23IRVkU7b0mSq5g16xLYO0ZLTW075/+8ZZapxrgZCPhQm9U2iJo2npaELIAml2VtOltSikqP0wns3spmCRecKEQUURPULPlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MoDBQB7l; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MoDBQB7l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8819EC19425; Fri, 24 Apr 2026 13:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777037805; bh=W/DIn1G3lN4FeCsbrh0NiRUSGSJoLU0UB+W6qZVKdW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MoDBQB7lezgU1xHZJoHfKOzGDTIcZJ6e3+AM9JCc2wNhsIvp+rW5d/hg1yKBZ2SYj 6A0V3dH0lQfxDaYLjPy9sxXIse7jaQ7DJJnoPVeVkVYSewjMSHUGUKus7BnKbsVHtX zLkvBPu6yvZ9m6X2Cq5er/97KH8WY7Us4NUP+sdw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Clemens Ladisch , Takashi Sakamoto , Jaroslav Kysela , Takashi Iwai , stable , Takashi Iwai Subject: [PATCH 6.6 076/166] ALSA: fireworks: bound device-supplied status before string array lookup Date: Fri, 24 Apr 2026 15:29:50 +0200 Message-ID: <20260424132548.713305672@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424132532.812258529@linuxfoundation.org> References: <20260424132532.812258529@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman commit 07704bbf36f57e4379e4cadf96410dab14621e3b upstream. 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 Cc: Takashi Sakamoto Cc: Jaroslav Kysela Cc: Takashi Iwai Fixes: bde8a8f23bbe ("ALSA: fireworks: Add transaction and some commands") Cc: stable Assisted-by: gregkh_clanker_t1000 Signed-off-by: Greg Kroah-Hartman Reviewed-by: Takashi Sakamoto Link: https://patch.msgid.link/2026040953-astute-camera-1aa1@gregkh Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/fireworks/fireworks_command.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/sound/firewire/fireworks/fireworks_command.c +++ b/sound/firewire/fireworks/fireworks_command.c @@ -151,10 +151,13 @@ efw_transaction(struct snd_efw *efw, uns (be32_to_cpu(header->category) != category) || (be32_to_cpu(header->command) != command) || (be32_to_cpu(header->status) != EFR_STATUS_OK)) { + u32 st = be32_to_cpu(header->status); + dev_err(&efw->unit->device, "EFW command failed [%u/%u]: %s\n", be32_to_cpu(header->category), be32_to_cpu(header->command), - efr_status_names[be32_to_cpu(header->status)]); + st < ARRAY_SIZE(efr_status_names) ? + efr_status_names[st] : "unknown"); err = -EIO; goto end; }