crypto: hash - Fix page length clamping in hash walk
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 4 May 2016 09:52:56 +0000 (17:52 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 17 May 2016 17:42:59 +0000 (13:42 -0400)
commit1669540814a1cf57ff50e037c5bf84f831ea4e09
tree1057b39fecff2dad6457758af892a8102022b349
parenta10c059ad73b3b84c349592e72d445d9c73a1e27
crypto: hash - Fix page length clamping in hash walk

[ Upstream commit 13f4bb78cf6a312bbdec367ba3da044b09bf0e29 ]

The crypto hash walk code is broken when supplied with an offset
greater than or equal to PAGE_SIZE.  This patch fixes it by adjusting
walk->pg and walk->offset when this happens.

Cc: <stable@vger.kernel.org>
Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
crypto/ahash.c