Commit aef73cfcb913eae3d0deeb60eb385f75039db40b

Authored by Herbert Xu
1 parent 57cfe44bcc

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>

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

include/crypto/hash.h
... ... @@ -186,7 +186,7 @@
186 186  
187 187 static inline void ahash_request_free(struct ahash_request *req)
188 188 {
189   - kfree(req);
  189 + kzfree(req);
190 190 }
191 191  
192 192 static inline struct ahash_request *ahash_request_cast(
include/linux/crypto.h
... ... @@ -770,7 +770,7 @@
770 770  
771 771 static inline void ablkcipher_request_free(struct ablkcipher_request *req)
772 772 {
773   - kfree(req);
  773 + kzfree(req);
774 774 }
775 775  
776 776 static inline void ablkcipher_request_set_callback(
... ... @@ -901,7 +901,7 @@
901 901  
902 902 static inline void aead_request_free(struct aead_request *req)
903 903 {
904   - kfree(req);
  904 + kzfree(req);
905 905 }
906 906  
907 907 static inline void aead_request_set_callback(struct aead_request *req,