ASoC: Intel: avs: Fix potential RX buffer overflow
authorCezary Rojewski <cezary.rojewski@intel.com>
Mon, 10 Oct 2022 12:19:42 +0000 (14:19 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 17 Oct 2022 11:50:05 +0000 (12:50 +0100)
commit23ae34e033b2c0e5e88237af82b163b296fd6aa9
treefb9a1455ade7e5d4095c5946bed144264b0f635a
parent83375566a7a7042cb34b24986d100f46bfa0c1e5
ASoC: Intel: avs: Fix potential RX buffer overflow

If an event caused firmware to return invalid RX size for
LARGE_CONFIG_GET, memcpy_fromio() could end up copying too many bytes.
Fix by utilizing min_t().

Reported-by: CoolStar <coolstarorganization@gmail.com>
Fixes: f14a1c5a9f83 ("ASoC: Intel: avs: Add module management requests")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221010121955.718168-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/ipc.c