Skip to content

Commit 6b9ed21

Browse files
committed
Merge: crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/398 JIRA: https://issues.redhat.com/browse/RHEL-80114 CVE: CVE-2024-56690 Upstream Status: linux.git commit 662f2f1 Author: Yi Yang <yiyang13@huawei.com> Date: Tue Oct 15 02:09:35 2024 +0000 crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY Since commit 8f4f68e ("crypto: pcrypt - Fix hungtask for PADATA_RESET"), the pcrypt encryption and decryption operations return -EAGAIN when the CPU goes online or offline. In alg_test(), a WARN is generated when pcrypt_aead_decrypt() or pcrypt_aead_encrypt() returns -EAGAIN, the unnecessary panic will occur when panic_on_warn set 1. Fix this issue by calling crypto layer directly without parallelization in that case. Fixes: 8f4f68e ("crypto: pcrypt - Fix hungtask for PADATA_RESET") Signed-off-by: Yi Yang <yiyang13@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Herbert Xu <herbert.xu@redhat.com> Approved-by: Ondrej Mosnáček <omosnacek@gmail.com> Approved-by: Phil Auld <pauld@redhat.com> Approved-by: Vladis Dronov <vdronov@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 9b61665 + c59c7ea commit 6b9ed21

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

crypto/pcrypt.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
117117
err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu);
118118
if (!err)
119119
return -EINPROGRESS;
120-
if (err == -EBUSY)
121-
return -EAGAIN;
120+
if (err == -EBUSY) {
121+
/* try non-parallel mode */
122+
return crypto_aead_encrypt(creq);
123+
}
122124

123125
return err;
124126
}
@@ -166,8 +168,10 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
166168
err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu);
167169
if (!err)
168170
return -EINPROGRESS;
169-
if (err == -EBUSY)
170-
return -EAGAIN;
171+
if (err == -EBUSY) {
172+
/* try non-parallel mode */
173+
return crypto_aead_decrypt(creq);
174+
}
171175

172176
return err;
173177
}

0 commit comments

Comments
 (0)