Patch "crypto: caam - Pad SG length when allocating hash edesc" has been added to the 6.10-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: caam - Pad SG length when allocating hash edesc

to the 6.10-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-caam-pad-sg-length-when-allocating-hash-edesc.patch
and it can be found in the queue-6.10 subdirectory.

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



commit 57aa8c14acd22b2d626c02519ec5feabd90dccf1
Author: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date:   Thu Sep 12 17:57:13 2024 +0800

    crypto: caam - Pad SG length when allocating hash edesc
    
    [ Upstream commit 5124bc96162667766f6120b19f57a640c2eccb2a ]
    
    Because hardware will read in multiples of 4 SG entries, ensure
    the allocated length is always padded.  This was already done
    by some callers of ahash_edesc_alloc, but ahash_digest was conspicuously
    missing.
    
    In any case, doing it in the allocation function ensures that the
    memory is always there.
    
    Reported-by: Guangwu Zhang <guazhang@xxxxxxxxxx>
    Fixes: a5e5c13398f3 ("crypto: caam - fix S/G table passing page boundary")
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index fdd724228c2fa..25c02e2672585 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -708,6 +708,7 @@ static struct ahash_edesc *ahash_edesc_alloc(struct ahash_request *req,
 		       GFP_KERNEL : GFP_ATOMIC;
 	struct ahash_edesc *edesc;
 
+	sg_num = pad_sg_nents(sg_num);
 	edesc = kzalloc(struct_size(edesc, sec4_sg, sg_num), flags);
 	if (!edesc)
 		return NULL;




[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