[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201123083424.34f9ba9f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 23 Nov 2020 08:34:24 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Vadim Fedorenko <vfedorenko@...ek.ru>
Cc: Boris Pismenny <borisp@...dia.com>,
Aviad Yehezkel <aviadye@...dia.com>, netdev@...r.kernel.org
Subject: Re: [net v3] net/tls: missing received data after fast remote close
On Mon, 23 Nov 2020 13:40:46 +0000 Vadim Fedorenko wrote:
> On 20.11.2020 18:26, Jakub Kicinski wrote:
> > On Thu, 19 Nov 2020 18:59:48 +0300 Vadim Fedorenko wrote:
> >> 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.
> >> The flow that triggers the race is simple. Server sends small
> >> amount of data right after the connection is configured to use TLS
> >> and closes the connection. In this case receiver sees TLS Handshake
> >> data, configures TLS socket right after Change Cipher Spec record.
> >> While the configuration is in process, TCP socket receives small
> >> Application Data record, Encrypted Alert record and FIN packet. So
> >> the TCP socket changes sk_shutdown to RCV_SHUTDOWN and sk_flag with
> >> SK_DONE bit set. The received data is not parsed upon arrival and is
> >> never sent to user-space.
> >>
> >> Patch unpauses parser directly if we have unparsed data in tcp
> >> receive queue.
> >>
> >> Signed-off-by: Vadim Fedorenko <vfedorenko@...ek.ru>
> > Applied, thanks!
> Looks like I missed fixes tag to queue this patch to -stable.
>
> Fixes: c46234ebb4d1 ("tls: RX path for ktls")
I put this on:
Fixes: fcf4793e278e ("tls: check RCV_SHUTDOWN in tls_wait_data")
It's queued for stable, but it needs to hit Linus' tree first, so it'll
take another week or so to show up in stable releases.
Powered by blists - more mailing lists