forked from mirrors/linux
		
	crypto: algif - zeroize message digest buffer
Zeroize the buffer holding the message digest calculated for the consumer before the buffer is released by the hash AF_ALG interface handler. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
		
							parent
							
								
									4c7912e919
								
							
						
					
					
						commit
						2a6af25bef
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -258,6 +258,8 @@ static void hash_sock_destruct(struct sock *sk) | ||||||
| 	struct alg_sock *ask = alg_sk(sk); | 	struct alg_sock *ask = alg_sk(sk); | ||||||
| 	struct hash_ctx *ctx = ask->private; | 	struct hash_ctx *ctx = ask->private; | ||||||
| 
 | 
 | ||||||
|  | 	memzero_explicit(ctx->result, | ||||||
|  | 		     crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); | ||||||
| 	sock_kfree_s(sk, ctx->result, | 	sock_kfree_s(sk, ctx->result, | ||||||
| 		     crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); | 		     crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); | ||||||
| 	sock_kfree_s(sk, ctx, ctx->len); | 	sock_kfree_s(sk, ctx, ctx->len); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Stephan Mueller
						Stephan Mueller