diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-11 15:14:18 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-12 09:33:09 +0800 |
| commit | b2e689baf220408aff8ee5dfb4edb0817e1632bb (patch) | |
| tree | b9f08ec8067090ecbfc3e46bd9d28be1a37f42ab /include/crypto/hash.h | |
| parent | 9ae0c92fec69374c6db8dddb0df00d86b9afa5da (diff) | |
crypto: ahash - Disable request chaining
Disable hash request chaining in case a driver that copies an
ahash_request object by hand accidentally triggers chaining.
Reported-by: Manorit Chawdhry <m-chawdhry@ti.com>
Fixes: f2ffe5a9183d ("crypto: hash - Add request chaining API")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/hash.h')
| -rw-r--r-- | include/crypto/hash.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 2aa83ee0ec98..a67988316d06 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -10,6 +10,7 @@ #include <linux/atomic.h> #include <linux/crypto.h> +#include <linux/slab.h> #include <linux/string.h> /* Set this bit for virtual address instead of SG list. */ @@ -581,7 +582,10 @@ static inline struct ahash_request *ahash_request_alloc_noprof( * ahash_request_free() - zeroize and free the request data structure * @req: request data structure cipher handle to be freed */ -void ahash_request_free(struct ahash_request *req); +static inline void ahash_request_free(struct ahash_request *req) +{ + kfree_sensitive(req); +} static inline struct ahash_request *ahash_request_cast( struct crypto_async_request *req) |
