Skip to content

Commit

Permalink
crypto: async - Use kzfree for requests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Jul 12, 2009
1 parent 57cfe44 commit aef73cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/crypto/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static inline struct ahash_request *ahash_request_alloc(

static inline void ahash_request_free(struct ahash_request *req)
{
kfree(req);
kzfree(req);
}

static inline struct ahash_request *ahash_request_cast(
Expand Down
4 changes: 2 additions & 2 deletions include/linux/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc(

static inline void ablkcipher_request_free(struct ablkcipher_request *req)
{
kfree(req);
kzfree(req);
}

static inline void ablkcipher_request_set_callback(
Expand Down Expand Up @@ -901,7 +901,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm,

static inline void aead_request_free(struct aead_request *req)
{
kfree(req);
kzfree(req);
}

static inline void aead_request_set_callback(struct aead_request *req,
Expand Down

0 comments on commit aef73cf

Please sign in to comment.