diff options
author | Chengfeng Ye <cyeaa@connect.ust.hk> | 2021-11-04 06:28:07 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-11-20 15:02:08 +1100 |
commit | 4a9dbd021970ffe1b92521328377b699acba7c52 (patch) | |
tree | 78694383ad7767ed1daf5cb157511daeaa7b7ed0 | |
parent | 574c833ef3a60dc5dff6c9e885a30ba13e88971e (diff) | |
download | linux-stable-4a9dbd021970ffe1b92521328377b699acba7c52.tar.gz linux-stable-4a9dbd021970ffe1b92521328377b699acba7c52.tar.bz2 linux-stable-4a9dbd021970ffe1b92521328377b699acba7c52.zip |
crypto: qce - fix uaf on qce_aead_register_one
Pointer alg points to sub field of tmpl, it
is dereferenced after tmpl is freed. Fix
this by accessing alg before free tmpl.
Fixes: 9363efb4 ("crypto: qce - Add support for AEAD algorithms")
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Acked-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/qce/aead.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c index 290e2446a2f3..97a530171f07 100644 --- a/drivers/crypto/qce/aead.c +++ b/drivers/crypto/qce/aead.c @@ -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; } |