mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
tls: don't override sk_write_space if tls_set_sw_offload fails.
commitee181e5201
upstream. If we fail to enable tls in the kernel we shouldn't override the sk_write_space callback Fixes:3c4d755915
('tls: kernel TLS support') Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
93f16446c8
commit
2b8b2e7622
1 changed files with 2 additions and 3 deletions
|
@ -429,9 +429,6 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
|
|||
goto err_crypto_info;
|
||||
}
|
||||
|
||||
ctx->sk_write_space = sk->sk_write_space;
|
||||
sk->sk_write_space = tls_write_space;
|
||||
|
||||
/* currently SW is default, we will have ethtool in future */
|
||||
rc = tls_set_sw_offload(sk, ctx);
|
||||
tx_conf = TLS_SW_TX;
|
||||
|
@ -440,6 +437,8 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
|
|||
|
||||
ctx->tx_conf = tx_conf;
|
||||
update_sk_prot(sk, ctx);
|
||||
ctx->sk_write_space = sk->sk_write_space;
|
||||
sk->sk_write_space = tls_write_space;
|
||||
goto out;
|
||||
|
||||
err_crypto_info:
|
||||
|
|
Loading…
Reference in a new issue