From: Antoine Tenart Date: Mon, 27 May 2019 14:51:01 +0000 (+0200) Subject: crypto: inside-secure - fix zeroing of the request in ahash_exit_inv X-Git-Tag: microblaze-v5.4-rc1~105^2~85 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=b926213d6fede9c9427d7c12eaf7d9f0895deb4e;p=linux-2.6-microblaze.git crypto: inside-secure - fix zeroing of the request in ahash_exit_inv A request is zeroed in safexcel_ahash_exit_inv(). This request total size is EIP197_AHASH_REQ_SIZE while the memset zeroing it uses sizeof(struct ahash_request), which happens to be less than EIP197_AHASH_REQ_SIZE. This patch fixes it. Fixes: f6beaea30487 ("crypto: inside-secure - authenc(hmac(sha256), cbc(aes)) support") Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index a79a73bb3969..ba0732fd4ed4 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -487,7 +487,7 @@ static int safexcel_ahash_exit_inv(struct crypto_tfm *tfm) struct safexcel_inv_result result = {}; int ring = ctx->base.ring; - memset(req, 0, sizeof(struct ahash_request)); + memset(req, 0, EIP197_AHASH_REQ_SIZE); /* create invalidation request */ init_completion(&result.completion);