aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/mpiutil.c
diff options
context:
space:
mode:
authorQiu-ji Chen <[email protected]>2024-09-30 18:12:16 +0800
committerMark Brown <[email protected]>2024-11-05 12:53:27 +0000
commit1157733344651ca505e259d6554591ff156922fa (patch)
treec1f0706094f82a81602f86a186e6f1661bece33f /lib/crypto/mpi/mpiutil.c
parent159098859bf6d46b34a1e1f7d44d28987b875878 (diff)
ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata()
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: 6d817c0e9fd7 ("ASoC: codecs: Add da7219 codec driver") Cc: [email protected] Signed-off-by: Qiu-ji Chen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions