Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795025939; b=jZF5QxTUNdPIGRsVcEkcuQ3V6HiuG1gcs8ymewwPrAGjGmrLTC3sM6zMgBvwvqYKi+fv D6pBBpjvJThlpsAKGqRN5e+Vxi04gIvLB54S5gLo/2RyuWC+5doQccfoIctq59CIdcETP iNKUkPEqqy+6XoSzgouOMV8BFyro9NLqZxMqYQxH5UdBySXzcReilNftOAMU6u9EuV1t/ B6MwJh1zcUDNWkl30hqaeqzOBuRDm8t744oKmTibTsAtjJG9RK9B/7qnmZzN9zgN4WtTg OiNYX9ZjJTrQ3QNWeUzFiv4EOS0sP3BWCMI+0o7R2yRoh/EcF+is8yivZXf+Z7wCsbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795025939; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=taUjHjx6A79f/lhj3T1pmWn4FG/nJt2/XCpdxg1jJpA=; b=hd5DiSb021NLE9xNBbI8V3wA1BC+j6SGdVCjXXcb/24hUhazPtAj/jZu7mooAbMRr5JX ERIJYb+2JcMla4u3ugnzrUPpJow1chHPXxu1jpZIUFNThLI5dTVYqBdaCQOu18pkbMaxJ AazUbg8K1DCOHBmU+NWP3wVjcjuLNtPqdCmiABoSqty6shJJJGQ4bm8/3x9NhT5tf3mtv aVEemd5aLZtta/HxE0s5h5jas5IL3jfSu7e+9O4ygDB6H0vi1uohOvRAajv+wokRVe809 qN3A/x5u9RneY7zWvla+i/wXF+ozI4ADldHi9Ob1FQeEnymtvtNzFmnX7hxzMZUnl4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=CTxWXfaJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FE72606A330; Wed, 18 Nov 2026 18:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=CTxWXfaJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 231D81F000C4; Wed, 18 Nov 2026 18:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795025938; bh=taUjHjx6A79f/lhj3T1pmWn4FG/nJt2/XCpdxg1jJpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CTxWXfaJyviipMBSQl5VTzFq35vEoPwteBA5ACN9RfXv+WDLOehwY26b+2Qw6vD1v iu4PJxBIvbc6yoOyq8PJKkQ4bucqqUWlQ51GdKgA3ZYeiaivYLa+6U76CmlFf5orhd Ao7qPrfUiWiCLGcfgo8sFv4e0z1yJIaST5CHabXM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Takashi Iwai , Sasha Levin Subject: [PATCH 6.18 1258/2151] ALSA: usb-audio: Check mixer matrix size for UAC2/3 at parsing Date: Wed, 18 Nov 2026 15:49:53 +0100 Message-ID: <20261118150207.987587879@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai [ Upstream commit 22185ffd7b31885d03fdeb20055a8707779a70f9 ] The matrix of input/output channels specified in a UAC2/3 mixer unit must fit to the upper limit 256. Add a sanity check and returns an error if an invalid size is detected. Link: https://lore.kernel.org/d46fcac6-bd7e-4fc4-95e1-4e8d39f92ad3@zipdox.net Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20260930155356.348608-2-tiwai@suse.de Stable-dep-of: c01fb2ed90c0 ("ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation") Signed-off-by: Sasha Levin --- sound/usb/mixer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 72bd94b44ce34..b0af62a54563b 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -2283,6 +2283,16 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, num_outs = err; input_pins = desc->bNrInPins; + if (state->mixer->protocol == UAC_VERSION_2 || + state->mixer->protocol == UAC_VERSION_3) { + if (input_pins * num_outs > 256) { + usb_audio_err(state->chip, + "invalid channels for MIXER UNIT %d: input=%d, output=%d\n", + unitid, input_pins, num_outs); + return -EINVAL; + } + } + num_ins = 0; ich = 0; for (pin = 0; pin < input_pins; pin++) { -- 2.53.0