diff options
| author | Julius Bairaktaris <julius@bairaktaris.de> | 2026-11-11 09:06:23 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-11-18 17:37:19 +0000 |
| commit | 3857bc06e5a40c5ebb62917147375a811f010aa0 (patch) | |
| tree | 0df38dab7633e049b77f8f3a6051f66611a21fd1 /tools/perf/scripts/python | |
| parent | aebb7274476403040d582c61478df8f4a7bf9cd3 (diff) | |
ASoC: qcom: q6apm-dai: reject compress rings larger than the DMA buffer
q6apm_dai_compr_open() allocates a fixed 8 MiB DMA buffer, but
q6apm_dai_compr_set_params() takes the ring size from the fragment size
and count that userspace passes to SNDRV_COMPRESS_SET_PARAMS without
checking it against that buffer. The compress core checks the geometry
against the runtime buffer only for drivers without a copy callback.
q6apm_compr_copy() places each write() at the stream position modulo the
ring size, so a ring larger than the DMA buffer lets write() copy user
data past its end, and after SNDRV_COMPRESS_NEXT_TRACK the copy starts at
the next multiple of the fragment size.
Reject a ring larger than the DMA buffer.
Fixes: c317d148a2b0 ("ASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks")
Cc: stable@vger.kernel.org
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20261111080624.244291-2-julius@bairaktaris.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
