mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
net: tls, fix sk_write_space NULL write when tx disabled
The ctx->sk_write_space pointer is only set when TLS tx mode is enabled.
When running without TX mode its a null pointer but we still set the
sk sk_write_space pointer on close().
Fix the close path to only overwrite sk->sk_write_space when the current
pointer is to the tls_write_space function indicating the tls module should
clean it up properly as well.
Reported-by: Hillf Danton <[email protected]>
Cc: Ying Xue <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Fixes: 57c722e932 ("net/tls: swap sk_write_space on close")
Signed-off-by: John Fastabend <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6f967f8b1b
commit
d85f017758
1 changed files with 2 additions and 1 deletions
|
|
@ -308,7 +308,8 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
|
|||
if (free_ctx)
|
||||
icsk->icsk_ulp_data = NULL;
|
||||
sk->sk_prot = ctx->sk_proto;
|
||||
sk->sk_write_space = ctx->sk_write_space;
|
||||
if (sk->sk_write_space == tls_write_space)
|
||||
sk->sk_write_space = ctx->sk_write_space;
|
||||
write_unlock_bh(&sk->sk_callback_lock);
|
||||
release_sock(sk);
|
||||
if (ctx->tx_conf == TLS_SW)
|
||||
|
|
|
|||
Loading…
Reference in a new issue