]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Intel: sst: Fix firmware name size handling
authorChristian Engelmayer <cengelma@gmx.at>
Sat, 7 Feb 2015 22:40:52 +0000 (23:40 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 8 Feb 2015 03:08:27 +0000 (11:08 +0800)
commita054cd7c6da434129b636dab6c52b97bf70dac68
tree1c4726682f64ce4c3226e7b177ab5c1dde8b78a7
parentcc3097db5b14dfb0825270f1f81e7485cbcb1fc8
ASoC: Intel: sst: Fix firmware name size handling

Function sst_acpi_probe() uses plain strcpy for setting member firmware_name
of a struct intel_sst_drv from member firmware of a struct sst_machines.
Thereby the destination array has got a length of 20 byte while the source may
hold 32 byte. Since eg. commit 5f582876dd87 ("ASoC: Intel: Fix BYTCR firmware
name") increased strings from "fw_sst_0f28.bin" to "intel/fw_sst_0f28.bin"
there is an actual possibility that the 20 byte array at the end of struct
intel_sst_drv is overrun.

Thus increase the size of the destination and use the same define for both
structs. Detected by Coverity CID 1260087.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/intel/sst/sst.h
sound/soc/intel/sst/sst_acpi.c