WSL2-Linux-Kernel/sound/soc/sof/imx
Peter Ujfalusi d9be4a88c3
ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types
i.MX8 only uses SOF_FW_BLK_TYPE_IRAM (1) and SOF_FW_BLK_TYPE_SRAM (3)
bars, everything else is left as 0 in sdev->bar[] array.

If a broken or purposefully crafted firmware image is loaded with other
types of FW_BLK_TYPE then a kernel crash can be triggered.

Make sure that only IRAM/SRAM type is converted to bar index.

Fixes: afb93d7165 ("ASoC: SOF: imx: Add i.MX8M HW support")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:23:49 +01:00
..
Kconfig ASoC: SOF: imx: fix Kconfig punctuation 2020-11-12 17:17:57 +00:00
Makefile ASoC: SOF: imx: Add debug support for imx platforms 2020-09-17 15:53:15 +01:00
imx-common.c ASoC: SOF: imx: update kernel-doc description 2020-12-11 13:23:03 +00:00
imx-common.h ASoC: SOF: imx: Add debug support for imx platforms 2020-09-17 15:53:15 +01:00
imx8.c ASoC: SOF: imx: imx8: Bar index is only valid for IRAM and SRAM types 2021-09-15 16:23:48 +01:00
imx8m.c ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types 2021-09-15 16:23:49 +01:00