From: netdev-bot+sashiko@kernel.org
To: rjethwani@purestorage.com
Cc: netdev@vger.kernel.org, kuba@kernel.org
Subject: Re: [PATCH net v2 2/4] tls: device: fix next-record sequence in core-driven RX resync
Date: Mon, 26 Oct 2026 22:48:28 +0000 [thread overview]
Message-ID: <179305490892.3134.14812552886616716829@kernel.org> (raw)
In-Reply-To: <20261022221732.1397620-3-rjethwani@purestorage.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 (1) · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In tls_device_core_ctrl_rx_resync() (net/tls/tls_device.c),
this patch makes the next-record sequence sent to the device…
Pre-existing issues:
- [Medium] The other CORE_NEXT_HINT resync path, tls_rx_msg_size() ->
tls_device_rx_resync_new_rec() (net/tls/tls_sw.c:2234-2235 at this…
--
tls: device: fix next-record sequence in core-driven RX resync
tls_device_core_ctrl_rx_resync() used to pass tcp_sk(sk)->copied_seq to
tls_device_resync_rx() as the TCP sequence of the next record. This patch
passes tls_strp_msg_seq() + rxm->full_len instead. The commit message
says the result is the start of the next record in both strparser modes.
> diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
> index fbfe6ec3df048..a6c4d0cc54c73 100644
> --- a/net/tls/tls_device.c
> +++ b/net/tls/tls_device.c
[ ... ]
> @@ -877,8 +878,9 @@ static void tls_device_core_ctrl_rx_resync(struct tls_context *tls_ctx,
> memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size);
> tls_bigint_increment(rcd_sn, prot->rec_seq_size);
>
> - tls_device_resync_rx(tls_ctx, sk, tcp_sk(sk)->copied_seq,
> - rcd_sn);
> + tls_device_resync_rx(tls_ctx, sk,
> + tls_strp_msg_seq(sw_ctx) +
> + rxm->full_len, rcd_sn);
[Severity: Medium]
The sequence passed here no longer depends on the strparser mode. Does the
check that picks this branch still depend on it?
Earlier in tls_device_core_ctrl_rx_resync():
/* head of next rec is already in, parser will sync for us */
if (tcp_inq(sk) > rxm->full_len) {
trace_tls_device_rx_resync_nh_schedule(sk);
ctx->resync_nh_do_now = 1;
} else {
tcp_inq() counts from copied_seq. In copy mode, tls_strp_read_copy() has
already moved copied_seq past the current record, so tcp_inq() counts only
the bytes of the next record.
Suppose between 1 and rxm->full_len bytes of the next record are already
queued. The else branch runs, and tls_dev_resync() is called for a TCP
position the device has already passed. resync_nh_do_now is never set, so
tls_device_rx_resync_new_rec() also returns early:
case TLS_OFFLOAD_SYNC_TYPE_CORE_NEXT_HINT:
if (likely(!rx_ctx->resync_nh_do_now))
return;
Would this waste the resync attempt and keep the stream on software
decryption until the backed-off retry?
This tcp_inq() check was already there before this patch. The later commit
"tls: device: fix next-record queued checks in core-driven RX resync" in
this series appears to fix it. That commit replaces the check with
after(READ_ONCE(tcp_sk(sk)->rcv_nxt), next_seq).
[Severity: Medium]
This is a pre-existing issue and was not introduced by this patch. The
commit message says the reported sequence "no longer depends on which mode
the strparser is in". Does that also hold for the other CORE_NEXT_HINT
path?
tls_rx_msg_size() in net/tls/tls_sw.c still computes the record start from
the anchor skb:
tls_device_rx_resync_new_rec(strp->sk, data_len + TLS_HEADER_SIZE,
TCP_SKB_CB(skb)->seq + strp->stm.offset);
In copy mode, tls_strp_read_copy() resets stm.offset to 0 but keeps the
anchor's old cb. The value above can then be lower than the real record
start, while tls_device_core_ctrl_rx_resync() now uses strp->seq.
When tls_device_core_ctrl_rx_resync() sets resync_nh_do_now, it hands the
resync to this path. tls_device_rx_resync_new_rec() also still assumes
normal mode:
/* head of next rec is already in, note that the sock_inq will
* include the currently parsed message when called from parser
*/
sock_data = tcp_inq(sk);
if (sock_data > rcd_len) {
In copy mode, could the device then get the wrong next-record boundary for
CORE_NEXT_HINT? Could the request sequence also fail to match for
DRIVER_REQ and DRIVER_REQ_ASYNC?
Two later commits in this series look like they fix this:
"tls: device: fix record start reported to RX resync in copy mode"
changes the argument to strp->seq.
"tls: device: fix next-record queued checks in core-driven RX resync"
changes the tcp_inq() check in tls_device_rx_resync_new_rec() to
READ_ONCE(tcp_sk(sk)->rcv_nxt) - seq.
> }
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261022221732.1397620-1-rjethwani%40purestorage.com
next prev parent reply other threads:[~2026-10-26 22:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 22:14 [PATCH net v2 0/4] tls: device: fix RX record start tracking after strparser rework Rishikesh Jethwani
2026-10-22 22:14 ` [PATCH net v2 1/4] tls: device: fix record start in the tls_device_decrypted tracepoint Rishikesh Jethwani
2026-10-22 22:14 ` [PATCH net v2 2/4] tls: device: fix next-record sequence in core-driven RX resync Rishikesh Jethwani
2026-10-26 22:48 ` netdev-bot+sashiko [this message]
2026-10-27 17:52 ` Rishikesh Jethwani
2026-10-22 22:14 ` [PATCH net v2 3/4] tls: device: fix record start reported to RX resync in copy mode Rishikesh Jethwani
2026-10-22 22:15 ` [PATCH net v2 4/4] tls: device: fix next-record queued checks in core-driven RX resync Rishikesh Jethwani
2026-10-28 23:15 ` [PATCH net v2 0/4] tls: device: fix RX record start tracking after strparser rework 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=179305490892.3134.14812552886616716829@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rjethwani@purestorage.com \
/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.