提交 575e3b07 编写于 作者: A Ard Biesheuvel 提交者: Xie XiuQi

crypto: arm64/aes-ccm - don't use an atomic walk needlessly

mainline inclusion
from mainline-5.0
commit f9352900
category: bugfix
bugzilla: 11170
CVE: NA

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

When the AES-CCM code was first added, the NEON register were saved
and restored eagerly, and so the code avoided doing so, and executed
the scatterwalk in atomic context inside the kernel_neon_begin/end
section.

This has been changed in the meantime, so switch to non-atomic
scatterwalks.

Fixes: bd2ad885 ("crypto: arm64/aes-ce-ccm - move kernel mode neon ...")
Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NChen Zhou <chenzhou10@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3d2ea7d9
...@@ -255,7 +255,7 @@ static int ccm_encrypt(struct aead_request *req) ...@@ -255,7 +255,7 @@ static int ccm_encrypt(struct aead_request *req)
/* preserve the original iv for the final round */ /* preserve the original iv for the final round */
memcpy(buf, req->iv, AES_BLOCK_SIZE); memcpy(buf, req->iv, AES_BLOCK_SIZE);
err = skcipher_walk_aead_encrypt(&walk, req, true); err = skcipher_walk_aead_encrypt(&walk, req, false);
if (may_use_simd()) { if (may_use_simd()) {
while (walk.nbytes) { while (walk.nbytes) {
...@@ -313,7 +313,7 @@ static int ccm_decrypt(struct aead_request *req) ...@@ -313,7 +313,7 @@ static int ccm_decrypt(struct aead_request *req)
/* preserve the original iv for the final round */ /* preserve the original iv for the final round */
memcpy(buf, req->iv, AES_BLOCK_SIZE); memcpy(buf, req->iv, AES_BLOCK_SIZE);
err = skcipher_walk_aead_decrypt(&walk, req, true); err = skcipher_walk_aead_decrypt(&walk, req, false);
if (may_use_simd()) { if (may_use_simd()) {
while (walk.nbytes) { while (walk.nbytes) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册