Skip to content

Commit aef73cf

Browse files
committed
crypto: async - Use kzfree for requests
This patch changes the kfree call to kzfree for async requests. As the request may contain sensitive data it needs to be zeroed before it can be reallocated by others. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 57cfe44 commit aef73cf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎include/crypto/hash.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static inline struct ahash_request *ahash_request_alloc(
186186

187187
static inline void ahash_request_free(struct ahash_request *req)
188188
{
189-
kfree(req);
189+
kzfree(req);
190190
}
191191

192192
static inline struct ahash_request *ahash_request_cast(

‎include/linux/crypto.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc(
770770

771771
static inline void ablkcipher_request_free(struct ablkcipher_request *req)
772772
{
773-
kfree(req);
773+
kzfree(req);
774774
}
775775

776776
static inline void ablkcipher_request_set_callback(
@@ -901,7 +901,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm,
901901

902902
static inline void aead_request_free(struct aead_request *req)
903903
{
904-
kfree(req);
904+
kzfree(req);
905905
}
906906

907907
static inline void aead_request_set_callback(struct aead_request *req,

0 commit comments

Comments
 (0)