ASoC: fsl_asrc/fsl_easrc: fix memory safety issues
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 2/25 patches 1 replyIn review
- v2 posting 1/20 of 5 patches 1 replySuperseded
- v15 patches 5 repliesSuperseded
Changes in v2 from the cover letter
- Patch 1: drop the 8-bit output path, ASRC does not support 8-bit output (Shengjiu Wang).
- Patches 2-5: add Reviewed-by tags, no code changes.
Patches in v2 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | ASoC: fsl_asrc_m2m: fix out-of-bounds write when draining the output FIFOsound/ | +12 | 1 reply | |
| 2/5 | ASoC: fsl_asrc: fix pair ownership on repeated or failed hw_paramssound/ | +22 | 0 replies | |
| 3/5 | ASoC: fsl_asrc_dma: release DMA channels on repeated hw_paramssound/ | +18 | 0 replies | |
| 4/5 | ASoC: fsl_easrc: fix context ownership on repeated hw_paramssound/ | +10 | 0 replies | |
| 5/5 | ASoC: fsl_asrc_m2m: allow only one task at a time per streamsound/ | +7 | 0 replies |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Shengjiu Wang |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | R-b |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/5] ASoC: fsl_asrc/fsl_easrc: fix memory safety issues
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).
Changes since v1:
- Patch 1: drop the 8-bit output path, ASRC does not support 8-bit output (Shengjiu Wang).
- Patches 2-5: add Reviewed-by tags, no code changes.
v1: https://lore.kernel.org/linux-sound/[email protected]/T/
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 | 30 +++++++++++++++++++----------- sound/soc/fsl/fsl_easrc.c | 10 ++++++++++ 4 files changed, 69 insertions(+), 20 deletions(-)
Signature · 1 line
2.53.0