sst-linux/sound
Qiu-ji Chen 687c5f18b0 ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata()
commit 1157733344651ca505e259d6554591ff156922fa 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
..
ac97
aoa
arm
atmel
core ALSA: core: add isascii() check to card ID generator 2024-10-17 15:21:52 +02:00
drivers
firewire ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() 2024-11-14 13:15:13 +01:00
hda ASoC: Intel: sst: Support LPE0F28 ACPI HID 2024-12-14 19:53:08 +01:00
i2c
isa
mips
oss
parisc
pci ALSA: hda/realtek: Update ALC256 depop procedure 2024-12-14 19:53:53 +01:00
pcmcia
ppc
sh
soc ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata() 2024-12-14 19:53:58 +01:00
sparc
spi
synth ALSA: emux: improve patch ioctl data validation 2024-07-05 09:31:49 +02:00
usb ALSA: usb-audio: Fix potential out-of-bound accesses for Extigy and Mbox devices 2024-12-14 19:53:56 +01:00
virtio
x86
xen
ac97_bus.c
Kconfig sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML 2024-11-17 15:07:20 +01:00
last.c
Makefile
sound_core.c