]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tls: Avoid copying crypto_info again after cipher_type check.
authorIlya Lesokhin <ilyal@mellanox.com>
Mon, 13 Nov 2017 08:22:48 +0000 (10:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 18:41:10 +0000 (19:41 +0100)
commit93f16446c8ddacbf26ae8408ecd9c9c397b8d5b4
tree15606bd50dc43ef7e2bf3d92d3af3fd4f1c41963
parent797b8bb47fb27ee49a3b59ad110e5264585415aa
tls: Avoid copying crypto_info again after cipher_type check.

commit 196c31b4b54474b31dee3c30352c45c2a93e9226 upstream.

Avoid copying crypto_info again after cipher_type check
to avoid a TOCTOU exploits.
The temporary array on the stack is removed as we don't really need it

Fixes: 3c4d7559159b ('tls: kernel TLS support')
Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 4.14: Preserve changes made by earlier backports of
 "tls: return -EBUSY if crypto_info is already set" and "tls: zero the
 crypto information from tls_context before freeing"]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tls/tls_main.c