Skip to content

Commit

Permalink
crypto: qce - fix uaf on qce_ahash_register_one
Browse files Browse the repository at this point in the history
Pointer base points to sub field of tmpl, it
is dereferenced after tmpl is freed. Fix
this by accessing base before free tmpl.

Fixes: ec8f5d8 ("crypto: qce - Qualcomm crypto engine driver")
Signed-off-by: Chengfeng Ye <[email protected]>
Acked-by: Thara Gopinath <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Ychame authored and herbertx committed Nov 20, 2021
1 parent 4a9dbd0 commit b4cb4d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/qce/sha.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def,

ret = crypto_register_ahash(alg);
if (ret) {
kfree(tmpl);
dev_err(qce->dev, "%s registration failed\n", base->cra_name);
kfree(tmpl);
return ret;
}

Expand Down

0 comments on commit b4cb4d3

Please sign in to comment.