From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
willemb@google.com, horms@kernel.org, liyonglong@chinatelecom.cn,
shuah@kernel.org, fw@strlen.de, netdev@vger.kernel.org,
mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts
Date: Sat, 05 Dec 2026 22:04:12 +0000 [thread overview]
Message-ID: <179650825234.3148.5484969470030148952@kernel.org> (raw)
In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-7-1449de51adae@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 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] The patch is only a partial fix.
--
selftests: mptcp: sockopt: pass total bytes to do_getsockopts
After its read loop, connect_one_server() passed the return value of the
last read() to do_getsockopts() instead of the accumulated byte count.
This patch passes the total, so a partial final read() no longer trips
the write_seq assert in the MPTCP_INFO checks.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/638
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> index b6e58d936ebe5..7b4ccbe10ae18 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> @@ -627,7 +627,7 @@ static void connect_one_server(int fd, int pipefd)
> if (s.tcpi_rcv_delta)
> assert(s.tcpi_rcv_delta <= total);
>
> - do_getsockopts(&s, fd, ret, ret);
> + do_getsockopts(&s, fd, total, total);
[Severity: Medium]
The client side looks right now. Does the server side of the same echo
test have the same partial read problem?
The commit message says read() on a stream socket can return a partial
chunk. The peer function, process_one_client(), still does one read and
treats its result as the whole client payload, which is 128 to 4094
bytes sent with a single write():
tools/testing/selftests/net/mptcp/mptcp_sockopt.c:process_one_client() {
...
ret = read(fd, buf, sizeof(buf));
if (ret < 0)
die_perror("read");
assert(s.mptcpi_rcv_delta <= (uint64_t)ret);
if (s.tcpi_rcv_delta)
assert(s.tcpi_rcv_delta == (uint64_t)ret);
ret2 = write(fd, buf, ret);
...
/* wait for hangup */
ret3 = read(fd, buf, 1);
if (ret3 != 0)
xerror("expected EOF, got %lu", ret3);
do_getsockopts(&s, fd, ret, ret2);
...
}
If this first read() comes back short, the server echoes only ret bytes.
The client is still blocked in its loop waiting for len bytes, and the
rest of its payload is still in the server's receive queue.
Wouldn't the "wait for hangup" read() then return 1 rather than 0, so
that the "expected EOF" xerror() fires?
The partial ret is also used as the full received byte count in the
tcpi_rcv_delta assert and in do_getsockopts(&s, fd, ret, ret2). It is
used again in the mptcpi_rcv_delta != ret + 1 check and the
mptcpi_bytes_received and mptcpi_bytes_acked checks. That is the same
wrong byte count this patch fixes on the client.
Once the server exits, the client loop in connect_one_server() would see
EOF with total < len and fail too.
Since the client fix only holds when the server's single read() got the
whole payload, should process_one_client() also loop until it has read
the full payload, as connect_one_server() does?
None of the later patches in the series, including "selftests: mptcp:
sockopt: drop unreachable FIN accounting", appear to touch
process_one_client().
>
> if (eof)
> total += 1; /* sequence advances due to FIN */
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae%40kernel.org
next prev parent reply other threads:[~2026-12-05 22:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 21:44 [PATCH net-next 00/10] mptcp: misc improvements for v7.5 Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 01/10] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-12-05 22:04 ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-12-05 22:04 ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio Matthieu Baerts (NGI0)
2026-12-05 22:04 ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 06/10] selftests: mptcp: join: dump stats with right title Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts Matthieu Baerts (NGI0)
2026-12-05 22:04 ` netdev-bot+sashiko [this message]
2026-12-04 21:44 ` [PATCH net-next 08/10] selftests: mptcp: sockopt: drop unreachable FIN accounting Matthieu Baerts (NGI0)
2026-12-05 22:04 ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 09/10] mptcp: add msk_is_mptcp() helper Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 10/10] selftests: mptcp: print stats before socket closure Matthieu Baerts (NGI0)
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=179650825234.3148.5484969470030148952@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liyonglong@chinatelecom.cn \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox