]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: sun4i-ss - Fix invalid calculation of hash end
authorCorentin Labbe <clabbe.montjoie@gmail.com>
Thu, 18 Apr 2019 08:17:34 +0000 (10:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:24 +0000 (06:43 -0700)
commit8d4819fdff5a636eab44315ee7ba3b2033b65d8c
treedb709943ca67bd89d6bef41fe02f6df327090947
parentf34237009e4de37a9e376ce90400c26e4ef7541f
crypto: sun4i-ss - Fix invalid calculation of hash end

[ Upstream commit f87391558acf816b48f325a493d81d45dec40da0 ]

When nbytes < 4, end is wronlgy set to a negative value which, due to
uint, is then interpreted to a large value leading to a deadlock in the
following code.

This patch fix this problem.

Fixes: 6298e948215f ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/sunxi-ss/sun4i-ss-hash.c