3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lars-Peter Clausen <l...@metafoo.de>

commit 50c0f21b42dd4cd02b51f82274f66912d9a7fa32 upstream.

Make sure to check the version field of the firmware header to make sure to
not accidentally try to parse a firmware file with a different layout.
Trying to do so can result in loading invalid firmware code to the device.

Signed-off-by: Lars-Peter Clausen <l...@metafoo.de>
Signed-off-by: Mark Brown <broo...@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 sound/soc/codecs/sigmadsp.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/sound/soc/codecs/sigmadsp.c
+++ b/sound/soc/codecs/sigmadsp.c
@@ -176,6 +176,13 @@ static int _process_sigma_firmware(struc
                goto done;
        }
 
+       if (ssfw_head->version != 1) {
+               dev_err(dev,
+                       "Failed to load firmware: Invalid version %d. Supported 
firmware versions: 1\n",
+                       ssfw_head->version);
+               goto done;
+       }
+
        crc = crc32(0, fw->data + sizeof(*ssfw_head),
                        fw->size - sizeof(*ssfw_head));
        pr_debug("%s: crc=%x\n", __func__, crc);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to