tls: zero the crypto information from tls_context before freeing
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 12 Sep 2018 15:44:42 +0000 (17:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Sep 2018 10:06:01 +0000 (03:06 -0700)
commit0c0334299a7e085849c83bffe754626ba517d5ee
treec5590309e818f52a79890ddda2ef85fe8ef96514
parent10cacaf13189711ce5c81222aaae3cd61a5ca848
tls: zero the crypto information from tls_context before freeing

[ Upstream commit 86029d10af18381814881d6cce2dd6872163b59f ]

This contains key material in crypto_send_aes_gcm_128 and
crypto_recv_aes_gcm_128.

Introduce union tls_crypto_context, and replace the two identical
unions directly embedded in struct tls_context with it. We can then
use this union to clean up the memory in the new tls_ctx_free()
function.

Fixes: 3c4d7559159b ("tls: kernel TLS support")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/tls.h
net/tls/tls_main.c
net/tls/tls_sw.c