提交 0a9615ef 编写于 作者: C Chengfeng Ye 提交者: Yongqiang Liu

crypto: qce - fix uaf on qce_ahash_register_one

stable inclusion
from linux-4.19.226
commit 1aa6bac2dc1bce5f6afbb095c0ace374cc653947

--------------------------------

[ Upstream commit b4cb4d31 ]

Pointer base points to sub field of tmpl, it
is dereferenced after tmpl is freed. Fix
this by accessing base before free tmpl.

Fixes: ec8f5d8f ("crypto: qce - Qualcomm crypto engine driver")
Signed-off-by: NChengfeng Ye <cyeaa@connect.ust.hk>
Acked-by: NThara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 bbb1131b
...@@ -521,8 +521,8 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def, ...@@ -521,8 +521,8 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def,
ret = crypto_register_ahash(alg); ret = crypto_register_ahash(alg);
if (ret) { if (ret) {
kfree(tmpl);
dev_err(qce->dev, "%s registration failed\n", base->cra_name); dev_err(qce->dev, "%s registration failed\n", base->cra_name);
kfree(tmpl);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册