tls: Use kzalloc for aead_request allocation
authorIlya Lesokhin <ilyal@mellanox.com>
Mon, 13 Nov 2017 08:22:44 +0000 (10:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:53:13 +0000 (09:53 +0100)
[ Upstream commit 61ef6da622aa7b66bf92991bd272490eea6c712e ]

Use kzalloc for aead_request allocation as
we don't set all the bits in the request.

Fixes: 3c4d7559159b ('tls: kernel TLS support')
Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tls/tls_sw.c

index 7d80040..f00383a 100644 (file)
@@ -219,7 +219,7 @@ static int tls_do_encryption(struct tls_context *tls_ctx,
        struct aead_request *aead_req;
        int rc;
 
-       aead_req = kmalloc(req_size, flags);
+       aead_req = kzalloc(req_size, flags);
        if (!aead_req)
                return -ENOMEM;