Skip to content

Commit

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

Fixes: 9363efb ("crypto: qce - Add support for AEAD algorithms")
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 574c833 commit 4a9dbd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/qce/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,8 @@ static int qce_aead_register_one(const struct qce_aead_def *def, struct qce_devi

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

Expand Down

0 comments on commit 4a9dbd0

Please sign in to comment.