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 DEDAE35C68D; Tue, 21 Jul 2026 21:27:01 +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=1784669222; cv=none; b=klY3CRPPvzdWuaIyyxOyhR6ya2jVuQyGXiIoE/6JDrjzLbwcqmzQeFkVgU9IKwjY9EvicqLHwrBjVu9kueIbALYUG1qjlOl5//AtMNWS/PDSSzdw2KM9qT0eZupAgfpUVbotgwCvQ1OqSro1KuT0tqlNix849YGKqaamOpB7rXI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669222; c=relaxed/simple; bh=IvTyhVuOf4DQkZMvJ4kuhwSdjR2lLrmIBzdHkBiJb4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tOFv2kARhEoM0IsgLupe1Wgo3RZM969K4Rtrqn+cpvwZwSdxuhW22/joje5CsDqSzHY+iNvHsv4OaQdL4mP3E81Z/KbvdiyFqhbxNbOYtKBFDf8q+iEOc+KdxqGJV6sZG/ehIwFBpJBM+GHcTHGSDbROs1jfuqtH5ZSh8VleQUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=im0+aMqJ; 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="im0+aMqJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FCA91F00A3A; Tue, 21 Jul 2026 21:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784669221; bh=HSJf5QUTdL4qZHqdFXcfMWxUE11dksIiVi0aIVvlDzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=im0+aMqJQm4eHovC0xdyO+i4ODbjPOQkQ8Jn/46MqNsFt4aXDnXk/DPr6uZ99jUW7 TK77/Jv3j34/aALY3yhWG1ihEZG/7IZiyMF1bXwN4swgR38fHw+QPvcAqDNGpLybUC /eZWnO9dUoxe+EmsUGnGqUolAKCxZm7E1IJrWxEY= 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.1 0430/1067] ASoC: fsl: fsl_audmix: Validate written enum values Date: Tue, 21 Jul 2026 17:17:11 +0200 Message-ID: <20260721152434.238673948@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@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.1-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 acb499a5043c83..f391fc95daa7fe 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