linux/sound/soc
Dawid Wróbel dbc81b518f ASoC: codecs: lpass-tx-macro: Fix enum kcontrol accesses
[ Upstream commit 1ba381759e ]

The "DEC0 MODE" to "DEC7 MODE" controls are enumerated, but
tx_macro_dec_mode_get() and tx_macro_dec_mode_put() access their
value through ucontrol->value.integer.value[0] (a long) instead of
ucontrol->value.enumerated.item[0] (an unsigned int).

This same pattern was fixed in the sibling drivers by
commit bcfe5f76cc ("ASoC: codecs: rx-macro: fix accessing array
out of bounds for enum type") and
commit 0ea5eff7c6 ("ASoC: codecs: va-macro: fix accessing array
out of bounds for enum type"), but tx-macro was missed.

On 64-bit kernels built with CONFIG_SND_CTL_DEBUG, the elem value
sanity check catches the 4 bytes written past the enumerated item
and every read of these controls fails with -EINVAL:

  snd-sm8250 sound: control 2:0:0:DEC0 MODE:0: access overflow

Fixes: c39667ddcf ("ASoC: codecs: lpass-tx-macro: add support for lpass tx macro")
Assisted-by: Claude:claude-fable-5
Cc: stable@vger.kernel.org
Signed-off-by: Dawid Wróbel <me@dawidwrobel.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260730-worktree-lpass-tx-macro-enum-fix-v2-1-6d091c736116@dawidwrobel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ kept `snd_soc_kcontrol_component()` context line instead of upstream's renamed `snd_kcontrol_chip()` ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-08-27 14:28:21 +02:00
..
adi ASoC: axi-i2s: Use devm_platform_get_and_ioremap_resource() 2021-06-14 15:01:03 +01:00
amd ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition 2026-04-18 10:33:13 +02:00
atmel Revert "ASoC: atmel: Remove system clock tree configuration for at91sam9g20ek" 2024-01-25 14:52:31 -08:00
au1x ASoC: allow module autoloading for table db1200_pids 2024-10-17 15:10:38 +02:00
bcm ASoC: bcm: bcm63xx-pcm-whistler: Check return value of of_dma_configure() 2026-01-19 13:09:38 +01:00
cirrus ASoC: cirrus: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:48 +00:00
codecs ASoC: codecs: lpass-tx-macro: Fix enum kcontrol accesses 2026-08-27 14:28:21 +02:00
dwc ASoC: dwc: move DMA init to snd_soc_dai_driver probe() 2023-06-21 15:59:13 +02:00
fsl ASoC: fsl: fsl_audmix: Validate written enum values 2026-07-24 15:51:34 +02:00
generic ASoC: soc-dai.h: merge DAI call back functions into ops 2025-08-28 16:24:26 +02:00
hisilicon ASoC: hisilicon: Use devm_platform_get_and_ioremap_resource() 2021-06-15 16:39:49 +01:00
img ASoC: img-spdif-out: Use devm_platform_get_and_ioremap_resource() 2021-06-15 16:39:47 +01:00
intel ASoC: Intel: bytcht_es8316: Fix MCLK leak on init errors 2026-06-19 13:33:23 +02:00
jz4740 ASoC: jz4740-i2s: Handle independent FIFO flush bits 2023-01-12 11:58:57 +01:00
kirkwood ASoC: kirkwood: Fix potential NULL dereference 2024-06-16 13:39:27 +02:00
mediatek ASoC: mediatek: mt8192: Check runtime resume during probe 2026-08-23 14:17:20 +02:00
meson ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop 2026-08-19 17:13:53 +02:00
mxs ASoC: mxs-saif: Fix refcount leak in mxs_saif_probe 2022-06-09 10:22:56 +02:00
pxa ARM: pxa: spitz: use gpio descriptors for audio 2024-08-19 05:44:54 +02:00
qcom ASoC: qcom: q6asm-dai: do not set stream state in event and trigger callbacks 2026-06-19 13:33:29 +02:00
rockchip ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume() 2022-12-31 13:14:45 +01:00
samsung ASoC: samsung: Add missing depends on I2C 2025-02-01 18:24:00 +01:00
sh ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime() 2025-04-10 14:31:50 +02:00
sof ASoC: SOF: Intel: hda-stream: Fix incorrect variable used in error message 2025-10-02 13:39:08 +02:00
spear ASoC: spear: spdif_out: Use devm_platform_get_and_ioremap_resource() 2021-06-17 13:47:06 +01:00
sprd ASoC: sprd: Use managed buffer allocation 2021-08-04 08:10:27 +02:00
sti ASoC: sti: use managed regmap_field allocations 2026-06-01 17:35:29 +02:00
stm ASoC: stm32_sai: fix incorrect BCLK polarity for DSP_A/B, LEFT_J 2026-06-01 17:35:01 +02:00
sunxi ASoC: sun4i-spdif: Add clock multiplier settings 2025-03-13 12:50:00 +01:00
tegra ASoC: tegra: tegra210_ahub: Validate written enum value 2026-07-24 15:51:35 +02:00
ti ASoC: davinci-evm: Fix reference leak in davinci_evm_probe 2026-02-11 13:35:30 +01:00
uniphier ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA 2022-01-27 11:04:06 +01:00
ux500 ASoC: ux500: mop500: align function prototype 2021-03-31 18:03:28 +01:00
xilinx ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers 2026-08-23 14:17:31 +02:00
xtensa ASoC: xtensa: use asoc_substream_to_rtd() 2020-07-23 19:07:42 +01:00
Kconfig ASoC: topology: Select SND_DYNAMIC_MINORS 2021-07-27 13:13:04 +01:00
Makefile ASoC: topology: adhere to KUNIT formatting standard 2021-04-14 15:26:24 +01:00
soc-ac97.c ASoC: soc-ac97: cleanup cppcheck warning 2021-08-16 13:29:36 +01:00
soc-acpi.c ASoC: soc-acpi: remove useless initialization 2021-04-19 14:03:29 +01:00
soc-card.c ASoC: soc-card: add snd_soc_card_remove_dai_link() 2020-05-30 02:11:42 +01:00
soc-component.c ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get() 2021-08-16 13:29:35 +01:00
soc-compress.c ASoC: soc-compress: Inherit atomicity from DAI link for Compress FE 2023-05-17 11:50:26 +02:00
soc-core.c ASoC: soc-core: call missing INIT_LIST_HEAD() for card_aux_list 2026-06-01 17:35:01 +02:00
soc-dai.c ASoC: soc-dai.h: merge DAI call back functions into ops 2025-08-28 16:24:26 +02:00
soc-dapm.c ASoC: soc-dapm: set bias_level if snd_soc_dapm_set_bias_level() was successed 2025-08-28 16:24:18 +02:00
soc-devres.c ASoC: core: Remove only the registered component in devm functions 2020-07-07 11:55:46 +01:00
soc-generic-dmaengine-pcm.c ALSA: dmaengine: Synchronize dma channel after drop() 2024-07-27 10:46:11 +02:00
soc-jack.c ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB 2021-08-16 13:29:34 +01:00
soc-link.c ASoC: soc-pcm: care trigger rollback 2020-12-09 12:13:38 +00:00
soc-ops.c ASoC: ops: dynamically allocate struct snd_ctl_elem_value 2025-08-28 16:24:06 +02:00
soc-pcm.c ASoC: soc-pcm: test if a BE can be prepared 2023-06-21 15:59:13 +02:00
soc-topology-test.c ASoC: topology: KUnit: Convert from cpu to data format 2021-02-02 17:08:21 +00:00
soc-topology.c ASoC: topology: Properly initialize soc_enum values 2024-09-12 11:07:47 +02:00
soc-utils.c ASoC: soc-utils: Export snd_soc_dai_is_dummy() symbol 2023-10-10 21:59:04 +02:00