]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 15 Sep 2021 12:21:09 +0000 (15:21 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 15 Sep 2021 15:23:49 +0000 (16:23 +0100)
commit49bf7596aca344af8fb57237aa63554e15315305
treea033465c4157bbe3f6e4be079bbb711511088e25
parent101c6f465aa4bdb0bc5de382ea8ddd1560eadf77
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: 7b7894e7f3481 ("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>
sound/soc/sof/imx/imx8m.c