From: sashiko-bot@kernel.org
To: "Geliang Tang" <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v28 02/11] selftests: mptcp: connect: check TFO SIOCINQ overflow
Date: Mon, 16 Nov 2026 06:57:42 +0000 [thread overview]
Message-ID: <sashiko-outbox-216349@kernel.org> (raw)
In-Reply-To: <b10fc6fab784ca954d079569f58ed19155961e5d.1794810809.git.tanggeliang@kylinos.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests: mptcp: wrong tcp_inq.last check in
do_recvmsg_cmsg()
--
commit 433dfaca5d6ee692d7ae8856021861abcc097f8b
Author: Geliang Tang <geliang@kernel.org>
selftests: mptcp: connect: check TFO SIOCINQ overflow
This commit adds a SIOCINQ overflow check in mptcp_connect's server mode
when MPTFO is enabled and updates TCP_INQ EOF tracking in
do_recvmsg_cmsg().
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
> index 178d98d91fea2..3ae018a2a2155 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
[ ... ]
> @@ -571,6 +575,10 @@ static ssize_t do_recvmsg_cmsg(const int fd, char *buf, const size_t len)
> } else {
> tcp_inq.expect_eof = true;
> }
> + } else if ((size_t)ret < len &&
> + last_hint == (unsigned int)ret &&
> + tcp_inq.last == 0) {
> + tcp_inq.expect_eof = true;
> }
> }
[Severity: Medium]
Should this check tcp_inq.last == 1 instead of tcp_inq.last == 0?
When the receive queue is drained after DATA_FIN (RCV_SHUTDOWN),
mptcp_inq_hint() returns 1, whereas it returns 0 when the receive queue
is empty on a still-open connection:
net/mptcp/protocol.c:mptcp_inq_hint() {
...
if (!hint_val &&
(sk->sk_state == TCP_CLOSE || (sk->sk_shutdown & RCV_SHUTDOWN)))
return 1;
return (unsigned int)hint_val;
}
If a read partially consumes the queued data (setting last_hint = N) and
the next read drains the remaining N bytes before the peer's next write
arrives, tcp_inq.last is 0 while the connection is still open. Setting
tcp_inq.expect_eof = true here causes the next do_recvmsg_cmsg() call
that receives subsequent data to abort the test with xerror("expected
EOF..."), while actual EOF after DATA_FIN sets tcp_inq.last = 1 and
never matches this branch.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794810809.git.tanggeliang@kylinos.cn?part=2
next prev parent reply other threads:[~2026-11-16 6:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 6:38 [PATCH mptcp-next v28 00/11] Reduce the differences between TCP and MPTCP for TLS usage Geliang Tang
2026-11-16 6:38 ` [PATCH mptcp-net v28 01/11] mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint Geliang Tang
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:38 ` [PATCH mptcp-next v28 02/11] selftests: mptcp: connect: check TFO SIOCINQ overflow Geliang Tang
2026-11-16 6:57 ` sashiko-bot [this message]
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:38 ` [PATCH mptcp-net v28 03/11] mptcp: fix fallback dummy mapping anchor Geliang Tang
2026-11-16 6:38 ` [PATCH mptcp-next v28 04/11] mptcp: drop the mptcp_ooo_try_coalesce() helper Geliang Tang
2026-11-16 6:38 ` [PATCH mptcp-next v28 05/11] mptcp: drop the cant_coalesce CB field Geliang Tang
2026-11-16 6:38 ` [PATCH mptcp-next v28 06/11] mptcp: add flags field to mptcp_skb_cb Geliang Tang
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:39 ` [PATCH mptcp-next v28 07/11] mptcp: encapsulate CB DSN field access with helpers Geliang Tang
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:39 ` [PATCH mptcp-next v28 08/11] mptcp: remove CB offset field Geliang Tang
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:39 ` [PATCH mptcp-next v28 09/11] mptcp: drop data after DATA_FIN before skb init Geliang Tang
2026-11-16 7:37 ` sashiko-bot
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:39 ` [PATCH mptcp-next v28 10/11] mptcp: sync mptcp skb cb layout with tcp one Geliang Tang
2026-11-16 8:10 ` sashiko-bot
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 6:39 ` [PATCH mptcp-next v28 11/11] mptcp: defer read_sock cleanup to mptcp_worker Geliang Tang
2026-11-17 22:41 ` netdev-bot+sashiko
2026-11-16 8:33 ` [PATCH mptcp-next v28 00/11] Reduce the differences between TCP and MPTCP for TLS usage MPTCP CI
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=sashiko-outbox-216349@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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.