mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: qcom: Fix sc7280 lpass potential buffer overflow
@ 2025-04-01 20:40 Evgeny Pimenov
  2025-04-07 23:48 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Evgeny Pimenov @ 2025-04-01 20:40 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Evgeny Pimenov, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Venkata Prasad Potturu, Srinivasa Rao Mandadapu,
	linux-sound, linux-arm-msm, linux-kernel, lvc-patches,
	Fedor Pchelkin, Mikhail Kobuk, Alexey Khoroshilov, stable

Case values introduced in commit
5f78e1fb7a3e ("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: 77d0ffef793d ("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>
---
 sound/soc/qcom/lpass.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 27a2bf9a6613..de3ec6f594c1 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -13,10 +13,11 @@
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <dt-bindings/sound/qcom,lpass.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
 #include "lpass-hdmi.h"
 
 #define LPASS_AHBIX_CLOCK_FREQUENCY		131072000
-#define LPASS_MAX_PORTS			(LPASS_CDC_DMA_VA_TX8 + 1)
+#define LPASS_MAX_PORTS			(DISPLAY_PORT_RX_7 + 1)
 #define LPASS_MAX_MI2S_PORTS			(8)
 #define LPASS_MAX_DMA_CHANNELS			(8)
 #define LPASS_MAX_HDMI_DMA_CHANNELS		(4)
-- 
2.39.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: qcom: Fix sc7280 lpass potential buffer overflow
  2025-04-01 20:40 [PATCH] ASoC: qcom: Fix sc7280 lpass potential buffer overflow Evgeny Pimenov
@ 2025-04-07 23:48 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-04-07 23:48 UTC (permalink / raw)
  To: Srinivas Kandagatla, Evgeny Pimenov
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Venkata Prasad Potturu, Srinivasa Rao Mandadapu, linux-sound,
	linux-arm-msm, linux-kernel, lvc-patches, Fedor Pchelkin,
	Mikhail Kobuk, Alexey Khoroshilov, stable

On Tue, 01 Apr 2025 23:40:58 +0300, Evgeny Pimenov wrote:
> Case values introduced in commit
> 5f78e1fb7a3e ("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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: qcom: Fix sc7280 lpass potential buffer overflow
      commit: a31a4934b31faea76e735bab17e63d02fcd8e029

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-07 23:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-01 20:40 [PATCH] ASoC: qcom: Fix sc7280 lpass potential buffer overflow Evgeny Pimenov
2025-04-07 23:48 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®