]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tls: clear key material from kernel memory when do_tls_setsockopt_conf fails
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 12 Sep 2018 15:44:43 +0000 (17:44 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:50:01 +0000 (19:50 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit c844eb46b7d43c2cf760169df5ae1d5b033af338 ]

Fixes: 3c4d7559159b ("tls: kernel TLS support")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/tls/tls_main.c

index ecce00288560a76da86896067ed6509a1777a22b..bb09355283b4ecbe133a91b14f36c9f2768b0266 100644 (file)
@@ -447,7 +447,7 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
        goto out;
 
 err_crypto_info:
-       memset(crypto_info, 0, sizeof(*crypto_info));
+       memzero_explicit(crypto_info, sizeof(union tls_crypto_context));
 out:
        return rc;
 }