Patch "crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     crypto-pcrypt-call-crypto-layer-directly-when-padata.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f591bc85a59fd35adbb350a182b9f5e334217572
Author: Yi Yang <yiyang13@xxxxxxxxxx>
Date:   Tue Oct 15 02:09:35 2024 +0000

    crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY
    
    [ Upstream commit 662f2f13e66d3883b9238b0b96b17886179e60e2 ]
    
    Since commit 8f4f68e788c3 ("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: 8f4f68e788c3 ("crypto: pcrypt - Fix hungtask for PADATA_RESET")
    Signed-off-by: Yi Yang <yiyang13@xxxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 005a36cb21bc4..2d7f98709e97c 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -117,8 +117,10 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
 	err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu);
 	if (!err)
 		return -EINPROGRESS;
-	if (err == -EBUSY)
-		return -EAGAIN;
+	if (err == -EBUSY) {
+		/* try non-parallel mode */
+		return crypto_aead_encrypt(creq);
+	}
 
 	return err;
 }
@@ -166,8 +168,10 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
 	err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu);
 	if (!err)
 		return -EINPROGRESS;
-	if (err == -EBUSY)
-		return -EAGAIN;
+	if (err == -EBUSY) {
+		/* try non-parallel mode */
+		return crypto_aead_decrypt(creq);
+	}
 
 	return err;
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux