]> git.baikalelectronics.ru Git - kernel.git/commit
tls: reset the crypto info if copy_from_user fails
authorBoris Pismenny <borisp@mellanox.com>
Wed, 14 Feb 2018 08:46:07 +0000 (10:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Feb 2018 20:05:19 +0000 (15:05 -0500)
commitb715dac719ccc8e1aaa104e012a55e9294df2409
treefd325d7e2199022ad42b2f7fa8a0b83c397cf835
parent3e7e3a0531ca6a5c5726ad9319b5d5c779534e1e
tls: reset the crypto info if copy_from_user fails

copy_from_user could copy some partial information, as a result
TLS_CRYPTO_INFO_READY(crypto_info) could be true while crypto_info is
using uninitialzed data.

This patch resets crypto_info when copy_from_user fails.

fixes: c2c217d10788 ("tls: kernel TLS support")
Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_main.c