From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 37F844028D9; Tue, 21 Jul 2026 17:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656683; cv=none; b=vCngVOG7E8vbCLPWqE9AbmWINFx5WBV6s5bU6Ax+cPhoNp5/W0Qx1WL1jR7+Z3Dns3c7u53s5aNhNGQMMcydBQp+GZor4TyrsILMCPrkDDuRin1mY/27jr4fCp6csxo6qY8edo9pCzeH211s8YkpX8v3jGBk3vienTqhQyEumNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656683; c=relaxed/simple; bh=z1T1L78D+lcpFPDOIH3W+RNfGxlbX7mcf3U454ZeE+g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C9SkDKfPbt4bQ0G7HbXPiiw7/I/HRiNR4NuOl4ROnolfDXwm6UNKv+KbKL3xzbUFQlAqluYZooP5e9fy4QeUkLoD//wOWaInmJvjxeRLQGLoiyAPffMysHzZoKLwZAvnbnPcvqDBB5rsd7sLrcAVzPwpLYI0fV4x5DpA3Sm+SgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KnQchCXW; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KnQchCXW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C69B1F00A3A; Tue, 21 Jul 2026 17:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784656679; bh=N4DqzfX8qvEuqwtRQshl4erxSxsTKrUxiJQOSkZFIwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KnQchCXW3PKz15CSRaxCA0Mulcg1uBrdzWdJ+JCYkH1S2QSDquXATO2CKPXfQT1Lj 9evUbDusBpZ7lL6pvD9/RGSkVD6KDIH7E8rLQwA+/bPIuJwYeEosVkhHdrF7o5aymC Z6vw0mf8yHFyOPmLtmJWeK85NCDmMSsF6nQv4RIk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, HyeongJun An , Mark Brown , Sasha Levin Subject: [PATCH 6.18 0479/1611] ASoC: fsl: fsl_audmix: Validate written enum values Date: Tue, 21 Jul 2026 17:09:55 +0200 Message-ID: <20260721152526.103716899@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: HyeongJun An [ Upstream commit 3cd17e4e2871114d5579fa7bc8da66faf7fc1930 ] fsl_audmix_put_mix_clk_src() and fsl_audmix_put_out_src() convert the user-provided enum item with snd_soc_enum_item_to_val() before checking whether the item is within the enum's item count. The generic snd_soc_put_enum_double() helper performs that validation, but these callbacks use the converted value first: the clock-source path tests it with BIT(), and the output-source path indexes the prms transition table with it. Reject out-of-range enum items before converting them. Fixes: be1df61cf06e ("ASoC: fsl: Add Audio Mixer CPU DAI driver") Assisted-by: Claude:claude-opus-4-8 Signed-off-by: HyeongJun An Link: https://patch.msgid.link/20260609124317.38046-4-sammiee5311@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_audmix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c index 7981d598ba139b..d9b0bd61755d56 100644 --- a/sound/soc/fsl/fsl_audmix.c +++ b/sound/soc/fsl/fsl_audmix.c @@ -117,6 +117,9 @@ static int fsl_audmix_put_mix_clk_src(struct snd_kcontrol *kcontrol, unsigned int *item = ucontrol->value.enumerated.item; unsigned int reg_val, val, mix_clk; + if (item[0] >= e->items) + return -EINVAL; + /* Get current state */ reg_val = snd_soc_component_read(comp, FSL_AUDMIX_CTR); mix_clk = ((reg_val & FSL_AUDMIX_CTR_MIXCLK_MASK) @@ -157,6 +160,9 @@ static int fsl_audmix_put_out_src(struct snd_kcontrol *kcontrol, unsigned int reg_val, val, mask = 0, ctr = 0; int ret; + if (item[0] >= e->items) + return -EINVAL; + /* Get current state */ reg_val = snd_soc_component_read(comp, FSL_AUDMIX_CTR); -- 2.53.0