From: Matthieu Baerts <matttbe@kernel.org>
To: Kyuwon Cho <kyuwoncho18@gmail.com>
Cc: Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
mptcp@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [BUG] mptcp: pm: WARNING in mptcp_check_listen_stop() when listen fails on a new endpoint listener
Date: Wed, 18 Nov 2026 19:18:59 +0100 [thread overview]
Message-ID: <5d651146-b21d-44da-9f15-860f0c9c2dc5@kernel.org> (raw)
In-Reply-To: <179502042942.2742790.17887994424282536144@gmail.com>
Hi Kyuwon,
Thank you for the bug report and the reproducer.
On 18/11/2026 17:59, Kyuwon Cho wrote:
> Hi Matthieu, Mat, Geliang,
>
> While testing v7.4-rc3 with an LLM-guided test generator that we are
> developing as a research prototype, we found that adding a "signal"
> endpoint with a port can trigger the WARN_ON_ONCE() in
> mptcp_check_listen_stop(). It happens when __inet_listen_sk() fails on
> the subflow of the listener that mptcp_pm_nl_create_listen_socket()
> creates, here because another socket took the port after the subflow's
> bind:
>
> ------------[ cut here ]------------
> WARNING: net/mptcp/protocol.c:3451 at mptcp_check_listen_stop.part.0+0x15c/0x220, CPU#0: test/116
(...)
Please always decode stacktraces with ./scripts/decode_stacktrace.sh.
> mptcp_pm_nl_create_listen_socket() binds the subflow, sets the MPTCP
> socket to TCP_LISTEN, and only then calls __inet_listen_sk() on the
> subflow:
>
> inet_sk_state_store(newsk, TCP_LISTEN);
> sock_set_flag(newsk, SOCK_RCU_FREE);
> lock_sock(ssk);
> WRITE_ONCE(mptcp_subflow_ctx(ssk)->pm_listener, true);
> err = __inet_listen_sk(ssk, backlog);
> ...
> return err;
>
> If __inet_listen_sk() fails, inet_csk_listen_start() puts the subflow
> back to TCP_CLOSE, but the MPTCP socket stays in TCP_LISTEN.
> mptcp_pm_nl_add_addr_doit() then releases the listener, and
> mptcp_check_listen_stop() finds an MPTCP socket in TCP_LISTEN whose
> first subflow is not:
>
> if (WARN_ON_ONCE(!ssk || inet_sk_state_load(ssk) != TCP_LISTEN))
> return;
>
> Matthieu's "mptcp: pm: kernel: count endpoint listeners as sockets in
> use" (17/34 of the mptcp-net series posted on 2026-11-13) notes that
> this socket stays in TCP_LISTEN when __inet_listen_sk() fails, and
> counts it accordingly; it does not change the warning.
Indeed, v1 of this patch did not fix the warning. Sashiko spotted the
same issue on v1, and I already fixed this issue locally (but the series
is huge now due to all the new reports from Sashiko, etc...). The v2
will be sent to the MPTCP ML soon, and I will add your Reported-by tag.
> __inet_listen_sk() fails there when another socket binds the port
> between the subflow's bind and its listen, and listen() then sees the
> conflict. In the reproducer, one thread adds and flushes a signal
> endpoint 127.0.0.1:10007 through the mptcp_pm genl family, and another
> binds and listens on the same port with TCP_REPAIR sockets, whose
> SK_FORCE_REUSE skips the conflict check at bind. About a quarter of the
> 3000 ADD_ADDR requests fail with EADDRINUSE; the warning comes from the
> ones that fail at listen rather than at bind. It runs as an
> unprivileged user (uid 65534) in its own user and network namespace.
> On an x86_64 QEMU guest with 2 vCPUs and KASAN (gcc 13.3), the warning
> shows up in every run (3 of 3 with the attached 168-line reproducer, 3
> of 3 with our original test).
>
> syzbot reported the same warning in 2023 through a different path, a
> tcp diag request closing the listener's subflow, which 4c0288299fd0
> ("mptcp: prevent tcp diag from closing listener subflows") fixed. The
> check and the TCP_LISTEN state of this listener both come from
> 57fc0f1ceaa4 ("mptcp: ensure listener is unhashed before updating the
> sk status").
>
> Checked against v7.4-rc3 (aebb72744764);
> mptcp_pm_nl_create_listen_socket() and mptcp_check_listen_stop() are
> the same in net (2a324a58a084). We searched lore and syzbot and found
> no other report of this path.
>
> The reproducer (repro.c) and the kernel config are attached.
Out of curiosity: if your LLM has already analysed the root cause and
has a reproducer, why not ask to generate a fix and send this patch
instead of the bug report? There are so many patches being shared today
that it is already hard to keep up. If maintainers also have to create
fixes for issues report by LLMs, that might not work. Sending a patch
after having passed a series of reviews by an internal Sashiko instance
on your side would be more helpful.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-11-18 18:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 16:59 Kyuwon Cho
2026-11-18 18:18 ` Matthieu Baerts [this message]
2026-11-18 18:31 ` Kyuwon Cho
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=5d651146-b21d-44da-9f15-860f0c9c2dc5@kernel.org \
--to=matttbe@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kyuwoncho18@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®