[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1605440628-1283-1-git-send-email-vfedorenko@novek.ru>
Date: Sun, 15 Nov 2020 14:43:48 +0300
From: Vadim Fedorenko <vfedorenko@...ek.ru>
To: Jakub Kicinski <kuba@...nel.org>,
Boris Pismenny <borisp@...dia.com>,
Aviad Yehezkel <aviadye@...dia.com>
Cc: Vadim Fedorenko <vfedorenko@...ek.ru>, netdev@...r.kernel.org
Subject: [net] net/tls: missing received data after fast remote close
In case when tcp socket received FIN after some data and the
parser haven't started before reading data caller will receive
an empty buffer. This behavior differs from plain TCP socket and
leads to special treating in user-space. Patch unpauses parser
directly if we have unparsed data in tcp receive queue.
Signed-off-by: Vadim Fedorenko <vfedorenko@...ek.ru>
---
net/tls/tls_sw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 2fe9e2c..4db6943 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1289,6 +1289,9 @@ static struct sk_buff *tls_wait_data(struct sock *sk, struct sk_psock *psock,
struct sk_buff *skb;
DEFINE_WAIT_FUNC(wait, woken_wake_function);
+ if (!ctx->recv_pkt && skb_queue_empty(&sk->sk_receive_queue))
+ __strp_unpause(&ctx->strp);
+
while (!(skb = ctx->recv_pkt) && sk_psock_queue_empty(psock)) {
if (sk->sk_err) {
*err = sock_error(sk);
--
1.8.3.1
Powered by blists - more mailing lists