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 D44B02E093A; Mon, 20 Apr 2026 15:53:01 +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=1776700381; cv=none; b=u+jUX7aPFmtXDKY0WkwhzqSseoLvT2qLHqHTESkHw9axob4sLil8sHjMD3HkLIy3aAAKM4XZofuG9C5wrkv/cssrysQ9uvBpWkmU2k199hceJrZJG56H9KyZcGSY3d6Q5YQTB6AqI8x0GJhlxBU603uVG4+VkiOSO5cDhh5QEAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776700381; c=relaxed/simple; bh=TE0AhqHLzOI64paO4CuNg5bmyI3SSEZBXC2UGl3ZDHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bHSTkNgs42OkTDt9CULoRVYnpMcBFEiHpXB3kneTQUPcejspufjhRwZtqlLLLceiFg9JOxjys4jsrtG0Mfrn4XTeXttBgbz0Fx5EocmdjVue0Y74+8gVaBUyVtqI8B/UGzxkKM+KdGnw+1kkrQzuavvmhrfDGaSiEC9c0WmJXSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2SA1cd6B; 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="2SA1cd6B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AE11C19425; Mon, 20 Apr 2026 15:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776700381; bh=TE0AhqHLzOI64paO4CuNg5bmyI3SSEZBXC2UGl3ZDHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2SA1cd6BnmgRPBc+dzwZsrW6Y316ICu9i8IZxddG4wVhNxqhc7fg7p2g2jFOfm17a rdFMUTKJeP/xFPuHPbWJmA759JsYQ1WBzknRImHzD11b6gTGjYsp1+LyYrVVlyPCGF MJA0XQvK+CM420nUoUvwiUadQXCF8Ia30cpLyT9Q= 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.19 151/220] ALSA: fireworks: bound device-supplied status before string array lookup Date: Mon, 20 Apr 2026 17:41:32 +0200 Message-ID: <20260420153939.465859491@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420153934.013228280@linuxfoundation.org> References: <20260420153934.013228280@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-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; }