ASoC: wm_adsp: Fix validation of firmware and coeff lengths
The checks for whether another region/block header could be present are subtracting the size from the current offset. Obviously we should instead subtract the offset from the size. The checks for whether the region/block data fit in the file are adding the data size to the current offset and header size, without checking for integer overflow. Rearrange these so that overflow is impossible. Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk> Acked-by: NCharles Keepax <ckeepax@opensource.cirrus.com> Tested-by: NCharles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Showing
想要评论请 注册 或 登录