Patch "crypto: marvell/cesa - Fix type mismatch warning" 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: marvell/cesa - Fix type mismatch warning

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-marvell-cesa-fix-type-mismatch-warning.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 64415a3c6468658f06fbcf645f1185698c988d81
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Tue May 23 10:33:04 2023 +0200

    crypto: marvell/cesa - Fix type mismatch warning
    
    [ Upstream commit efbc7764c4446566edb76ca05e903b5905673d2e ]
    
    Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") uncovered
    a type mismatch in cesa 3des support that leads to a memcpy beyond the
    end of a structure:
    
    In function 'fortify_memcpy_chk',
        inlined from 'mv_cesa_des3_ede_setkey' at drivers/crypto/marvell/cesa/cipher.c:307:2:
    include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
      583 |                         __write_overflow_field(p_size_field, size);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    This is probably harmless as the actual data that is copied has the correct
    type, but clearly worth fixing nonetheless.
    
    Fixes: 4ada48397823 ("crypto: marvell/cesa - add Triple-DES support")
    Cc: Kees Cook <keescook@xxxxxxxxxxxx>
    Cc: Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/marvell/cesa/cipher.c b/drivers/crypto/marvell/cesa/cipher.c
index c6f2fa753b7c0..0f37dfd42d850 100644
--- a/drivers/crypto/marvell/cesa/cipher.c
+++ b/drivers/crypto/marvell/cesa/cipher.c
@@ -297,7 +297,7 @@ static int mv_cesa_des_setkey(struct crypto_skcipher *cipher, const u8 *key,
 static int mv_cesa_des3_ede_setkey(struct crypto_skcipher *cipher,
 				   const u8 *key, unsigned int len)
 {
-	struct mv_cesa_des_ctx *ctx = crypto_skcipher_ctx(cipher);
+	struct mv_cesa_des3_ctx *ctx = crypto_skcipher_ctx(cipher);
 	int err;
 
 	err = verify_skcipher_des3_key(cipher, key);



[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