OpenCloudOS-Kernel/sound/soc/amd/acp
Gaosheng Cui 3420fdb8ae
ASoC: amd: acp: Fix possible UAF in acp_dma_open
Smatch report warning as follows:

sound/soc/amd/acp/acp-platform.c:199 acp_dma_open() warn:
  '&stream->list' not removed from list

If snd_pcm_hw_constraint_integer() fails in acp_dma_open(),
stream will be freed, but stream->list will not be removed from
adata->stream_list, then list traversal may cause UAF.

Fix by adding the newly allocated stream to the list once it's fully
initialised.

Fixes: 7929985cfe ("ASoC: amd: acp: Initialize list to store acp_stream during pcm_open")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20221118030056.3135960-1-cuigaosheng1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-18 11:50:29 +00:00
..
Kconfig ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00
Makefile ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00
acp-i2s.c ASoC: amd: acp: Add TDM slots setting support for ACP I2S controller 2022-10-18 19:16:48 +01:00
acp-legacy-mach.c ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00
acp-mach-common.c ASoC: amd: acp: Add setbias level for rt5682s codec in machine driver 2022-10-19 15:14:00 +01:00
acp-mach.h ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00
acp-pci.c ASoC: amd: acp: use devm_kcalloc() instead of devm_kzalloc() 2022-09-19 17:52:37 +01:00
acp-pdm.c ASoC: amd: acp: ACP code generic to support newer platforms 2022-07-08 18:53:14 +01:00
acp-platform.c ASoC: amd: acp: Fix possible UAF in acp_dma_open 2022-11-18 11:50:29 +00:00
acp-rembrandt.c ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00
acp-renoir.c ASoC: amd: acp: ACP code generic to support newer platforms 2022-07-08 18:53:14 +01:00
acp-sof-mach.c ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs instance 2022-06-06 12:35:01 +01:00
amd.h ASoC: amd: acp: Modify dai_id macros to be more generic 2022-08-28 22:04:03 +01:00
chip_offset_byte.h ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00