Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: cel@kernel.org
Cc: john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net,
	davem@davemloft.net, pabeni@redhat.com, horms@kernel.org,
	davejwatson@fb.com, shuah@kernel.org, qingfang.deng@linux.dev,
	edumazet@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v5 03/10] tls: Honor O_NONBLOCK in tls_sw_splice_read()
Date: Sun, 18 Oct 2026 19:22:56 +0000	[thread overview]
Message-ID: <179235137663.3135.14281539217109085008@kernel.org> (raw)
In-Reply-To: <20261014-tls-follow-on-v5-3-e76c301d4f05@kernel.org>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] Concern: the commit message for "tls: Honor O_NONBLOCK in
  tls_sw_splice_read()" justifies the patch partly with an event-loop…

--

tls: Honor O_NONBLOCK in tls_sw_splice_read()

This commit makes tls_sw_splice_read() treat the socket's O_NONBLOCK flag
as nonblocking, in addition to SPLICE_F_NONBLOCK. Splice and sendfile from
a nonblocking TLS socket then return -EAGAIN instead of sleeping in
tls_rx_rec_wait(), as they already do on a plain TCP socket.

> Polling first does not avoid the sleep once tls_sw_splice_read()
> consumes zero-length records. tls_sw_sock_is_readable() reports
> the socket readable while any record sits on rx_list, including a
> zero-length record that delivers no bytes to the pipe. The
> strparser announces a record before decryption, when the record's
> plaintext length is unknown, so the readiness test cannot screen
> such a record out. A splice that consumes the record and waits for
> the next stalls every connection an event loop multiplexes.

[Severity: Low]
This isn't a bug, but could the commit message say that this paragraph
describes behavior added later in the series?

At this commit, tls_sw_splice_read() has no retry loop. An empty record is
spliced as 0 bytes and consumed, and the function returns 0 without waiting
again:

net/tls/tls_sw.c:tls_sw_splice_read() {
    ...
	chunk = min_t(unsigned int, rxm->full_len, len);
	copied = skb_splice_bits(skb, sk, rxm->offset, pipe, chunk, flags);
    ...
}

The "consumes the record and waits for the next" path is added by the next
patch, "tls: Consume empty data records in tls_sw_splice_read()".

> An LLM audit of the TLS read paths found this defect. With empty
> records consumed, the zero_len_splice selftest, run on a
> nonblocking socket, reproduces the sleep.

The zero_len_splice selftest also doesn't exist in
tools/testing/selftests/net/tls.c at this commit. The only zero_len test
here uses recv. zero_len_splice is added later by "selftests: tls: Extend
coverage for zero-length records".

Both claims are worded conditionally ("once ... consumes zero-length
records", "With empty records consumed"). Putting this patch first in the
series also looks deliberate. The O_NONBLOCK problem in the first paragraph
exists on its own since c46234ebb4d1, so the Fixes: tag looks right.

Since this patch carries a Fixes: tag and may be backported alone, would it
help to say that the stall scenario and the zero_len_splice reference
depend on later patches in the series?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261014-tls-follow-on-v5-0-e76c301d4f05%40kernel.org

  reply	other threads:[~2026-10-18 19:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 18:28 [PATCH net-next v5 00/10] net/tls: Receive-path fixes for zero-length data records Chuck Lever
2026-10-14 18:28 ` [PATCH net-next v5 01/10] tls: Bound consecutive no-data records in tls_sw_read_sock() Chuck Lever
2026-10-18 19:22   ` netdev-bot+sashiko
2026-10-14 18:28 ` [PATCH net-next v5 02/10] tls: Check for a pending signal after an empty record Chuck Lever
2026-10-18 19:22   ` netdev-bot+sashiko
2026-10-14 18:28 ` [PATCH net-next v5 03/10] tls: Honor O_NONBLOCK in tls_sw_splice_read() Chuck Lever
2026-10-18 19:22   ` netdev-bot+sashiko [this message]
2026-10-14 18:28 ` [PATCH net-next v5 04/10] tls: Consume empty data records " Chuck Lever
2026-10-18 19:22   ` netdev-bot+sashiko
2026-10-14 18:28 ` [PATCH net-next v5 05/10] tls: Consume empty data records in tls_sw_recvmsg() Chuck Lever
2026-10-18 19:22   ` netdev-bot+sashiko
2026-10-14 18:28 ` [PATCH net-next v5 06/10] tls: Return copied data ahead of a run of empty records Chuck Lever
2026-10-18 19:23   ` netdev-bot+sashiko
2026-10-14 18:28 ` [PATCH net-next v5 07/10] selftests: tls: Skip the zero_len tests when TLS is unavailable Chuck Lever
2026-10-14 18:28 ` [PATCH net-next v5 08/10] selftests: tls: Extend coverage for zero-length records Chuck Lever
2026-10-14 18:28 ` [PATCH net-next v5 09/10] selftests: tls: Cover splice on a nonblocking socket Chuck Lever
2026-10-14 18:28 ` [PATCH net-next v5 10/10] selftests: tls: Cover the empty-record cap in splice Chuck Lever

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=179235137663.3135.14281539217109085008@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=cel@kernel.org \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qingfang.deng@linux.dev \
    --cc=sd@queasysnail.net \
    --cc=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox