All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vfedorenko@novek.ru>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Boris Pismenny <borisp@nvidia.com>,
	Aviad Yehezkel <aviadye@nvidia.com>,
	netdev@vger.kernel.org
Subject: Re: [net v3] net/tls: missing received data after fast remote close
Date: Mon, 23 Nov 2020 13:40:46 +0000	[thread overview]
Message-ID: <64311360-e363-133c-6862-4de1298942ee@novek.ru> (raw)
In-Reply-To: <20201120102637.7d36a9f1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

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@novek.ru>
> Applied, thanks!
Looks like I missed fixes tag to queue this patch to -stable.

Fixes: c46234ebb4d1 ("tls: RX path for ktls")


  reply	other threads:[~2020-11-23 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:59 [net v3] net/tls: missing received data after fast remote close Vadim Fedorenko
2020-11-20 18:26 ` Jakub Kicinski
2020-11-23 13:40   ` Vadim Fedorenko [this message]
2020-11-23 16:34     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64311360-e363-133c-6862-4de1298942ee@novek.ru \
    --to=vfedorenko@novek.ru \
    --cc=aviadye@nvidia.com \
    --cc=borisp@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.