diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-04-05 18:44:03 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-04-20 18:58:31 +0200 |
commit | 2d93913e22013cb941fa7e1cf3d5e6649bc2bfad (patch) | |
tree | fa9b7f7c9c17286b8cdb27e65a28e837a3f761d0 /drivers/crypto | |
parent | crypto: chelsio - Fix potential NULL pointer dereferences (diff) | |
download | linux-2d93913e22013cb941fa7e1cf3d5e6649bc2bfad.tar.xz linux-2d93913e22013cb941fa7e1cf3d5e6649bc2bfad.zip |
crypto: chelsio - don't leak information from the stack to userspace
The structure crypto_info contains fields that are not initialized and
only .version is set. The copy_to_user call is hence leaking information
from the stack to userspace which must be avoided. Fix this by zero'ing
all the unused fields.
Detected by CoverityScan, CID#1467421 ("Uninitialized scalar variable")
Fixes: a08943947873 ("crypto: chtls - Register chtls with net tls")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/chelsio/chtls/chtls_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_main.c b/drivers/crypto/chelsio/chtls/chtls_main.c index 007c45c38fc7..69f3756eb980 100644 --- a/drivers/crypto/chelsio/chtls/chtls_main.c +++ b/drivers/crypto/chelsio/chtls/chtls_main.c @@ -441,7 +441,7 @@ nomem: static int do_chtls_getsockopt(struct sock *sk, char __user *optval, int __user *optlen) { - struct tls_crypto_info crypto_info; + struct tls_crypto_info crypto_info = { 0 }; crypto_info.version = TLS_1_2_VERSION; if (copy_to_user(optval, &crypto_info, sizeof(struct tls_crypto_info))) |