mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: fsl_asrc/fsl_easrc: fix memory safety issues
@ 2026-11-10 12:07 Stefan Ghetu
  2026-11-10 12:07 ` [PATCH 1/5] ASoC: fsl_asrc_m2m: fix out-of-bounds write when draining Stefan Ghetu
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stefan Ghetu @ 2026-11-10 12:07 UTC (permalink / raw)
  To: Shengjiu Wang, Mark Brown, linux-sound
  Cc: daniel.baluta, Stefan Ghetu, Xiubo Li, Fabio Estevam,
	Nicolin Chen, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linuxppc-dev, linux-kernel

This series fixes memory safety issues in the ASRC and EASRC drivers
that can be triggered by a user with access to their PCM or compress
devices:

1. fsl_asrc_m2m: the output FIFO drain can write past the end of the
   output buffer.
2. fsl_asrc: a repeated hw_params() leaves a stale asrc->pair[] entry
   that points to freed memory after close, and hw_free() after a
   failed hw_params() can release the pair of another stream.
3. fsl_asrc_dma: DMA channels are leaked on a repeated hw_params(), and
   released twice after a Back-End configuration error.
4. fsl_easrc: the same repeated hw_params() issue for EASRC contexts.
5. fsl_asrc_m2m: more than one task per compress stream leads to double
   DMA channel release and a stale pair entry.

Patches 2 and 4 make the pair/context release ownership-checked; patch
5 relies on them. Please apply in order.

Validated on i.MX8MP (EASRC) and i.MX8QM (ASRC).

Stefan Ghetu (5):
  ASoC: fsl_asrc_m2m: fix out-of-bounds write when draining the output
    FIFO
  ASoC: fsl_asrc: fix pair ownership on repeated or failed hw_params
  ASoC: fsl_asrc_dma: release DMA channels on repeated hw_params
  ASoC: fsl_easrc: fix context ownership on repeated hw_params
  ASoC: fsl_asrc_m2m: allow only one task at a time per stream

 sound/soc/fsl/fsl_asrc.c     | 22 ++++++++++++++++++++++
 sound/soc/fsl/fsl_asrc_dma.c | 27 ++++++++++++++++++---------
 sound/soc/fsl/fsl_asrc_m2m.c | 25 +++++++++++++++++--------
 sound/soc/fsl/fsl_easrc.c    | 10 ++++++++++
 4 files changed, 67 insertions(+), 17 deletions(-)


base-commit: b810335a0699d1810683796b0e3ffe8827ddfe6c
-- 
2.53.0


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

end of thread, other threads:[~2026-11-10 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 12:07 [PATCH 0/5] ASoC: fsl_asrc/fsl_easrc: fix memory safety issues Stefan Ghetu
2026-11-10 12:07 ` [PATCH 1/5] ASoC: fsl_asrc_m2m: fix out-of-bounds write when draining Stefan Ghetu
2026-11-10 12:07 ` [PATCH 2/5] ASoC: fsl_asrc: fix pair ownership on repeated or failed Stefan Ghetu
2026-11-10 12:07 ` [PATCH 3/5] ASoC: fsl_asrc_dma: release DMA channels on repeated Stefan Ghetu
2026-11-10 12:07 ` [PATCH 4/5] ASoC: fsl_easrc: fix context ownership " Stefan Ghetu
2026-11-10 12:07 ` [PATCH 5/5] ASoC: fsl_asrc_m2m: allow only one task at a time per Stefan Ghetu

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®