crypto: omap-sham - huge buffer access fixes
authorTero Kristo <t-kristo@ti.com>
Wed, 27 May 2020 12:24:26 +0000 (15:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:29 +0000 (17:48 +0200)
commit13c2b1c37f80e03f0e35dacb80cdec9b2b7a8e63
tree6989c33ae76a54ab475ee704e8fe4f4a06a45db2
parent2dcef8fd3497d7db396d4da139d587650727c856
crypto: omap-sham - huge buffer access fixes

[ Upstream commit 6395166d7a19019d5e9574eb9ecdaf0028abb887 ]

The ctx internal buffer can only hold buflen amount of data, don't try
to copy over more than that. Also, initialize the context sg pointer
if we only have data in the context internal buffer, this can happen
when closing a hash with certain data amounts.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/omap-sham.c