linux-stable/sound/soc
Qiu-ji Chen 687c5f18b0 ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata()
commit 1157733344 upstream.

An atomicity violation occurs when the validity of the variables
da7219->clk_src and da7219->mclk_rate is being assessed. Since the entire
assessment is not protected by a lock, the da7219 variable might still be
in flux during the assessment, rendering this check invalid.

To fix this issue, we recommend adding a lock before the block
if ((da7219->clk_src == clk_id) && (da7219->mclk_rate == freq)) so that
the legitimacy check for da7219->clk_src and da7219->mclk_rate is
protected by the lock, ensuring the validity of the check.

This possible bug is found by an experimental static analysis tool
developed by our team. This tool analyzes the locking APIs
to extract function pairs that can be concurrently executed, and then
analyzes the instructions in the paired functions to identify possible
concurrency bugs including data races and atomicity violations.

Fixes: 6d817c0e9f ("ASoC: codecs: Add da7219 codec driver")
Cc: stable@vger.kernel.org
Signed-off-by: Qiu-ji Chen <chenqiuji666@gmail.com>
Link: https://patch.msgid.link/20240930101216.23723-1-chenqiuji666@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:53:58 +01:00
..
adi ASoC: adi: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:34 +01:00
amd ASoC: amd: yc: Add a quirk for microfone on Lenovo ThinkPad P14s Gen 5 21MES00B00 2024-12-14 19:53:58 +01:00
apple ASoC: apple: mca: Improve handling of unavailable DMA channels 2023-03-11 13:55:31 +01:00
atmel ASoC: atmel: mchp-pdmc: Skip ALSA restoration if substream runtime is uninitialized 2024-10-17 15:21:34 +02:00
au1x ASoC: allow module autoloading for table db1200_pids 2024-09-30 16:23:46 +02:00
bcm ASoC: bcm2835-i2s: Switch to use dev_err_probe() helper 2022-09-14 15:06:00 +01:00
cirrus ASoC: ep93xx: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:20 +01:00
codecs ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata() 2024-12-14 19:53:58 +01:00
dwc ASoC: dwc: move DMA init to snd_soc_dai_driver probe() 2023-06-21 16:00:53 +02:00
fsl ASoC: fsl_micfil: fix regmap_write_bits usage 2024-12-14 19:53:26 +01:00
generic ASoC: audio-graph-card2: Purge absent supplies for device tree nodes 2024-12-14 19:53:10 +01:00
hisilicon ASoC: hisilicon: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:24 +01:00
img ASoC: Refactor non_legacy_dai_naming flag 2022-06-29 16:58:08 +01:00
intel ASoC: Intel: sst: Fix used of uninitialized ctx to log an error 2024-12-14 19:53:57 +01:00
jz4740 ASoC: jz4740-i2s: Handle independent FIFO flush bits 2023-01-07 11:11:51 +01:00
kirkwood ASoC: kirkwood: Fix potential NULL dereference 2024-06-12 11:03:22 +02:00
mediatek ASoC: mediatek: mt8192: fix register configuration for tdm 2024-06-12 11:03:49 +02:00
meson ASoC: meson: axg-card: fix 'use-after-free' 2024-09-18 19:23:06 +02:00
mxs ASoC: mxs-saif: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:43 +01:00
pxa ASoC: pxa: fix a memory leak in probe() 2023-10-25 12:03:15 +02:00
qcom ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe() 2024-11-01 01:56:07 +01:00
rockchip ASoC: rockchip: i2s-tdm: Fix trcm mode by setting clock on right mclk 2024-07-05 09:31:44 +02:00
samsung ASoC: soc.h: remove num_cpus/codecs 2022-09-20 12:19:30 +01:00
sh ASoC: Use of_property_read_bool() for boolean properties 2023-10-19 23:08:51 +02:00
sof ASoC: SOF: mediatek: Add missing board compatible 2024-09-30 16:23:46 +02:00
spear ASoC: spear: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:18 +01:00
sprd
sti ASoC: sti-uniperf: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:29 +01:00
stm ASoC: stm: Prevent potential division by zero in stm32_sai_get_clk_div() 2024-12-14 19:53:10 +01:00
sunxi ASoC: sunxi: sun4i-i2s: fix LRCLK polarity in i2s mode 2024-09-12 11:10:29 +02:00
tegra ASoC: tegra: Fix CBB error during probe() 2024-09-12 11:10:28 +02:00
ti ASoC: ti: omap-hdmi: Fix too long driver name 2024-07-25 09:49:14 +02:00
uniphier ASoC: uniphier: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:55 +01:00
ux500 ASoC: ux500: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:41 +01:00
xilinx ASoC: xilinx: Suppress second error message about reset failure in .remove() 2022-07-05 16:44:31 +01:00
xtensa ASoC: xtensa: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:33 +01:00
Kconfig ASoC: apple: mca: Start new platform driver 2022-08-25 13:51:34 +01:00
Makefile ASoC: apple: mca: Start new platform driver 2022-08-25 13:51:34 +01:00
soc-ac97.c ASoC: Variable type completion 2022-08-17 13:00:27 +01:00
soc-acpi.c
soc-card.c ASoC: Introduce 'fixup_controls' card method 2022-06-10 13:32:20 +01:00
soc-component.c Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync" 2022-10-04 14:09:30 +01:00
soc-compress.c ASoC: soc-compress: Inherit atomicity from DAI link for Compress FE 2023-05-11 23:03:28 +09:00
soc-core.c ASoC: soc-core.c: Skip dummy codec when adding platforms 2024-04-13 13:05:19 +02:00
soc-dai.c ASoC: Change handling of unimplemented set_bclk_ratio 2022-08-19 13:19:59 +01:00
soc-dapm.c ASoC: dapm: Fix UAF for snd_soc_pcm_runtime object 2024-09-12 11:10:16 +02:00
soc-devres.c
soc-generic-dmaengine-pcm.c ALSA: dmaengine: Synchronize dma channel after drop() 2024-07-25 09:49:14 +02:00
soc-jack.c ASoC: soc-card: Create jack kcontrol without pins 2022-04-14 17:37:21 +01:00
soc-link.c
soc-ops.c ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw 2024-04-10 16:28:31 +02:00
soc-pcm.c ASoC: soc-pcm: test if a BE can be prepared 2023-06-21 16:00:53 +02:00
soc-topology-test.c ASoC: topology: KUnit: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:54 +01:00
soc-topology.c ASoC: topology: Properly initialize soc_enum values 2024-09-12 11:10:22 +02:00
soc-utils-test.c ASoC: soc-utils-test: Add test for snd_soc_params_to_bclk() 2022-08-17 15:19:14 +01:00
soc-utils.c ASoC: soc-utils: Export snd_soc_dai_is_dummy() symbol 2023-10-10 22:00:34 +02:00