firmware: Sigma: Prevent out of bounds memory access
commit3b958a46b7e81c432d7d6ef00ee4bd51ef2d39e2
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 28 Nov 2011 08:44:14 +0000 (28 09:44 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Dec 2011 16:54:34 +0000 (9 08:54 -0800)
tree050abab832a895b66525e72d89003b057d40ecdb
parentadc771853323bb695e50eab52299b82d675cd665
firmware: Sigma: Prevent out of bounds memory access

commit 4f718a29fe4908c2cea782f751e9805319684e2b upstream.

The SigmaDSP firmware loader currently does not perform enough boundary size
checks when processing the firmware. As a result it is possible that a
malformed firmware can cause an out of bounds memory access.

This patch adds checks which ensure that both the action header and the payload
are completely inside the firmware data boundaries before processing them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/firmware/sigma.c
include/linux/sigma.h