summaryrefslogtreecommitdiffstats
path: root/net/tls/tls_device.c
diff options
context:
space:
mode:
authorVakul Garg2019-03-12 09:22:57 +0100
committerDavid S. Miller2019-03-13 22:16:44 +0100
commit4504ab0e6eb801555368cbb3011ab0530f659d4b (patch)
tree22c9992083d02f39318e454246b5ee55189cc9c3 /net/tls/tls_device.c
parentnet_sched: return correct value for *notify* functions (diff)
downloadkernel-qcow2-linux-4504ab0e6eb801555368cbb3011ab0530f659d4b.tar.gz
kernel-qcow2-linux-4504ab0e6eb801555368cbb3011ab0530f659d4b.tar.xz
kernel-qcow2-linux-4504ab0e6eb801555368cbb3011ab0530f659d4b.zip
net/tls: Inform user space about send buffer availability
A previous fix ("tls: Fix write space handling") assumed that user space application gets informed about the socket send buffer availability when tls_push_sg() gets called. Inside tls_push_sg(), in case do_tcp_sendpages() returns 0, the function returns without calling ctx->sk_write_space. Further, the new function tls_sw_write_space() did not invoke ctx->sk_write_space. This leads to situation that user space application encounters a lockup always waiting for socket send buffer to become available. Rather than call ctx->sk_write_space from tls_push_sg(), it should be called from tls_write_space. So whenever tcp stack invokes sk->sk_write_space after freeing socket send buffer, we always declare the same to user space by the way of invoking ctx->sk_write_space. Fixes: 7463d3a2db0ef ("tls: Fix write space handling") Signed-off-by: Vakul Garg <vakul.garg@nxp.com> Reviewed-by: Boris Pismenny <borisp@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_device.c')
-rw-r--r--net/tls/tls_device.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index 4a1da837a733..135a7ee9db03 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -558,9 +558,6 @@ void tls_device_write_space(struct sock *sk, struct tls_context *ctx)
MSG_DONTWAIT | MSG_NOSIGNAL);
sk->sk_allocation = sk_allocation;
}
-
- if (!rc)
- ctx->sk_write_space(sk);
}
void handle_device_resync(struct sock *sk, u32 seq, u64 rcd_sn)