Skip to content

Commit

Permalink
crypto: inside-secure - fix zeroing of the request in ahash_exit_inv
Browse files Browse the repository at this point in the history
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: f6beaea ("crypto: inside-secure - authenc(hmac(sha256), cbc(aes)) support")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Antoine Tenart authored and Herbert Xu committed Jun 6, 2019
1 parent aa52428 commit b926213
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/inside-secure/safexcel_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b926213

Please sign in to comment.