Skip to content

Commit 2d93913

Browse files
Colin Ian Kingherbertx
authored andcommitted
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: a089439 ("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>
1 parent 3d8ccf9 commit 2d93913

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/crypto/chelsio/chtls/chtls_main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int chtls_uld_rx_handler(void *handle, const __be64 *rsp,
441441
static int do_chtls_getsockopt(struct sock *sk, char __user *optval,
442442
int __user *optlen)
443443
{
444-
struct tls_crypto_info crypto_info;
444+
struct tls_crypto_info crypto_info = { 0 };
445445

446446
crypto_info.version = TLS_1_2_VERSION;
447447
if (copy_to_user(optval, &crypto_info, sizeof(struct tls_crypto_info)))

0 commit comments

Comments
 (0)