Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 20:05, Herbert Xu wrote: On Mon, Apr 21, 2025 at 01:51:06PM +0800, Su Hui wrote: @@ -433,7 +434,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm, { struct aead_request *req; - req = kmalloc(sizeof(*req) + crypto_aead_reqsize(tfm), gfp

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 16:46, Su Hui wrote: On 2025/4/21 16:32, Christophe JAILLET wrote: Le 21/04/2025 à 09:43, Su Hui a écrit : On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator argu

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 16:32, Christophe JAILLET wrote: Le 21/04/2025 à 09:43, Su Hui a écrit : On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can pr

[PATCH v2 0/2] crypto: some cleanup and hardening

2025-04-21 Thread Su Hui
using size_add() to hardening kmalloc() and remove some redundant include headers. Compile test only. v2: - remove redundant include headers in v1 (). - add a patch to remove other redundant headers. v1: - https://lore.kernel.org/all/20250421055104.663552-1-su...@nfschina.com/ Su Hui (2

[PATCH v2 2/2] crypto: remove some redundant include headers

2025-04-21 Thread Su Hui
ready included . Remove these redundant headers to save some code space. Also remove when already included . Signed-off-by: Su Hui --- include/crypto/acompress.h| 4 include/crypto/aead.h | 4 include/crypto/aes.h | 1 - include/crypto/akcipher.h | 1 - incl

[PATCH v2 1/2] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui --- include/crypto/aead.h | 2 +- include/crypto/akcipher.h | 3 ++- include/crypto/kpp.h | 2 +- 3 files chang

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-21 Thread Su Hui
On 2025/4/21 15:10, Christophe JAILLET wrote: Le 21/04/2025 à 07:51, Su Hui a écrit : It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui ---   include/crypto/aead.h   

Re: [PATCH] crypto: using size_add() for kmalloc()

2025-04-20 Thread Su Hui
On 2025/4/21 13:51, Su Hui wrote: It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui --- include/crypto/aead.h | 3 ++- include/crypto/akcipher.h | 4 +++- include/c

[PATCH] crypto: using size_add() for kmalloc()

2025-04-20 Thread Su Hui
It's safer to use size_add() to replace open-coded aithmetic in allocator arguments, because size_add() can prevent possible overflow problem. Signed-off-by: Su Hui --- include/crypto/aead.h | 3 ++- include/crypto/akcipher.h | 4 +++- include/crypto/kpp.h | 3 ++- 3 files chang