Skip to content

Commit a31a493

Browse files
Bobik3310broonie
authored andcommitted
ASoC: qcom: Fix sc7280 lpass potential buffer overflow
Case values introduced in commit 5f78e1f ("ASoC: qcom: Add driver support for audioreach solution") cause out of bounds access in arrays of sc7280 driver data (e.g. in case of RX_CODEC_DMA_RX_0 in sc7280_snd_hw_params()). Redefine LPASS_MAX_PORTS to consider the maximum possible port id for q6dsp as sc7280 driver utilizes some of those values. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 77d0ffe ("ASoC: qcom: Add macro for lpass DAI id's max limit") Cc: stable@vger.kernel.org # v6.0+ Suggested-by: Mikhail Kobuk <m.kobuk@ispras.ru> Suggested-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Evgeny Pimenov <pimenoveu12@gmail.com> Link: https://patch.msgid.link/20250401204058.32261-1-pimenoveu12@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2b727b3 commit a31a493

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/qcom/lpass.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
#include <linux/platform_device.h>
1414
#include <linux/regmap.h>
1515
#include <dt-bindings/sound/qcom,lpass.h>
16+
#include <dt-bindings/sound/qcom,q6afe.h>
1617
#include "lpass-hdmi.h"
1718

1819
#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
19-
#define LPASS_MAX_PORTS (LPASS_CDC_DMA_VA_TX8 + 1)
20+
#define LPASS_MAX_PORTS (DISPLAY_PORT_RX_7 + 1)
2021
#define LPASS_MAX_MI2S_PORTS (8)
2122
#define LPASS_MAX_DMA_CHANNELS (8)
2223
#define LPASS_MAX_HDMI_DMA_CHANNELS (4)

0 commit comments

Comments
 (0)