Article View: linux.kernel.netdev
Article #18672Re: [BUG] mptcp: pm: WARNING in mptcp_check_listen_stop() when listen fails on a new endpoint listener
From: Matthieu Baerts
Date: Wed, 18 Nov 2026 18:18
Date: Wed, 18 Nov 2026 18:18
93 lines
15297 bytes
15297 bytes
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.
Technical Details
Message-ID:
<5d651146-b21d-44da-9f15-860f0c9c2dc5@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366327-linux-kernel-netdev=dewy.ruReferences:
<179502042942.2742790.17887994424282536144@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366327-linux-kernel-netdev=dewy.ru From: matttbe@kernel.org (Matthieu Baerts) Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <5d651146-b21d-44da-9f15-860f0c9c2dc5@kernel.org> References: <179502042942.2742790.17887994424282536144@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2661848"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:1BECH+Tj0maNoW6enfA7aMsLv34= sha256:9UfGlVnjT6jF4wi33lE6AYss0E0akHU+pqux0dY6EkU= sha1:fd+EwXDN2BlpfbugY3CS1N6WuYg= sha256:r4yobi1jpCaYmPaussoV1jmLPbaxLXYHoh51pShULPI= Content-Language: fr List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 49CC811535C; Wed, 18 Nov 2026 21:19:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Tq8b46pm5W4; Wed, 18 Nov 2026 21:19:29 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366327-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id CA07F115358; Wed, 18 Nov 2026 21:19:20 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id DDF5B3214E; Wed, 18 Nov 2026 18:19:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795025946; b=YAA4xKED7cddDqE4zIStbxMvXeQU4l+fJD0tuRstTcCVIeOnTlTUnzwXKCnmYf1xftLv joW4wm9O5PfrmQkCjaC9XhmVwGB+wYhBcXi+Oq4g4pX75MlPhSVVwCsdnKk0U3uC4La+J 4+n964fKphF55tK1wqbTYj+mVWfJ5JYQun4GarvWBPXHm+E62uHuWaWKqVSIMviPr6kII DLeCXbWpnttE9PHltYtMmfpAZ0Ko804qUmT1dy9ij5vQUsG+uKQ9V5Y+C4WcNVvZQUcGD ffwOlS525jovT0jhwDvmh0sM26kFFfidcq1F51CuUlsMdeVu10g9o2VwsihDKMDqNSA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795025946; h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:Content-Language:To:Cc:References:From:Autocrypt:Organization: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=ZFMbQmS5Ec95/BM5uCXJYmzAHLkYlZBGDKoiVn7chog=; b=14A8QDdcreLkuJK8ql2wK+RTfuoBOHRILtjy8TwA+NxkIa4uSJGXVhHLTIF5Yvbtky+l nUgCVa9Isg1LE5WUFMPU0cJXG/jiaVX1D4mOZkPMnKpAoKcfKUtOup9qHkNzUN0HGVSLL ORPfjwJHyyeh7b0RzeKdnFRDR3ctwt22j0YCGsdgd2GY9clfoVWxjXW50NA/dpPv9XzOo j9WhWZp6WAYdO72AtcCKjZ8RZFlo8uzw1fysfiprJJDyQhkkkXuTXXQEZMIENxzWo4Z4Y XyMnwP2wo3q/eNyVnl8xtV1xq7GK0KO0/TXwCjYD+ial7B2PQQBEwXywwHW9KH4257g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kkYzgU3a; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F84A60A2601; Wed, 18 Nov 2026 18:19:06 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kkYzgU3a X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795025945; b=wOEExCBl6eZGxvTVIsF3gJzQ7cGv+gICMIOv51hbRwbdHo7eRWG5OE1Cbh9UuvNQuzD9 xRaXYZUwFH8utmkYG6xMGkpu26QktVEjgl9DkCNJhO1vkDbRa4CJhkltuImYopLXM+MlY BndKa0jyHpHKUY0YjQ5MRcElAh14tcSVQwsNwkqoaP6o+hjrUBQFBFzu2ZHBSNgjO8lDi bSain2DMmGkNR0aFDoJJZFSgSFMSEWo4fYqaPs0DPVRcqNH5kWZZvFGfdET/8PzZl+gfY D4mPVQ1HNyoNd9jmAPsZrHbt3eHO6se59vJwAPYS3M0B0jJ6BvKRj42FT+XXw9EuGcQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795025945; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:Content-Language:To:Cc:References:From:Autocrypt:Organization: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=ZFMbQmS5Ec95/BM5uCXJYmzAHLkYlZBGDKoiVn7chog=; b=RlxAFdQNKddcZly+nAF0Z7xiRdVOx9NteB92Dykbw6mc+GrOj0uO2gE2hPtaVbNZgMjq rJo/TCD4R+/eR/GtmBCf8ZoP9ijmi8d8JdIbUK/Xt/xrcQLano2eQ6fPA/MMwTqm4pPxs CUKwMhKyOj3m45eowc1oGURp605XCZBEEJ+L3iFsA49Kb1RJfyfYabYH4IWrWXyuf1wTT xz4HJA2soETEGX14WkTY6di7Pp0huP+0xdUBCxnMpmLloggdCET5q54YuGan1MfXTjw8w Zk1akY+DlU8ILv1hJu7R0BXwGZ0Q/mxels+33y2I0v450Wp3DUIsan+AVKJDgejxuMQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kkYzgU3a; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ED40606A320; Wed, 18 Nov 2026 18:19:04 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F5FB1F000C6; Wed, 18 Nov 2026 18:19:02 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795025944; bh=ZFMbQmS5Ec95/BM5uCXJYmzAHLkYlZBGDKoiVn7chog=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=kkYzgU3akIg75redaOVqvHrrZvo4JOflhkjQY4vWtT7DdW30MWaIAnldG5yYqppcP RTxxnIzAgMo1D0D1wlvuVeQzLCNvEYs+/fhC87SOjITOiNpGIpEXU5r4PT8ga4I4b9 e4gZLt6cFPYREKttOodtJhYk7lIHsq6Qa3AfMFUBYxH3xz3lqyu7DblZZI9LobWGR2 0PuzZ/HKovMA98YBdOeQs3HDJlM2AD+wC97pix0I0bkXohSm5BFo8CGReFYdKvF/MO 7qSogrlDYhXVuKe1G5fS+2oRmzxgxDuSXpGEqylgTDwA5s4m8znz7ZwdOdh5hiHGS0 qwYQ4gUchr86w== X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird Beta X-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 X-Autocrypt: addr=matttbe@kernel.org; keydata= xsFNBFXj+ekBEAD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Cnb6AJCW9cKpC25+zxQqD2Zy0dK3u2RuKErajKBa/YWzuSaKAOkneFxG3LJIv Hl7iqPF+JDCjB5sAEQEAAcLBXwQYAQIACQUCVeP56QIbDAAKCRD2t4JPQmmgc5VnD/9YgbCr HR1FbMbm7td54UrYvZV/i7m3dIQNXK2e+Cbv5PXf19ce3XluaE+wA8D+vnIW5mbAAiojt3Mb 6p0WJS3QzbObzHNgAp3zy/L4lXwc6WW5vnpWAzqXFHP8D9PTpqvBALbXqL06smP47JqbyQxj Xf7D2rrPeIqbYmVY9da1KzMOVf3gReazYa89zZSdVkMojfWsbq05zwYU+SCWS3NiyF6QghbW voxbFwX1i/0xRwJiX9NNbRj1huVKQuS4W7rbWA87TrVQPXUAdkyd7FRYICNW+0gddysIwPoa KrLfx3Ba6Rpx0JznbrVOtXlihjl4KV8mtOPjYDY9u+8x412xXnlGl6AC4HLu2F3ECkamY4G6 UxejX+E6vW6Xe4n7H+rEX5UFgPRdYkS1TA/X3nMen9bouxNsvIJv7C6adZmMHqu/2azX7S7I vrxxySzOw9GxjoVTuzWMKWpDGP8n71IFeOot8JuPZtJ8omz+DZel+WCNZMVdVNLPOd5frqOv mpz0VhFAlNTjU1Vy0CnuxX3AM51J8dpdNyG0S8rADh6C8AKCDOfUstpq28/6oTaQv7QZdge0 JY6dglzGKnCi/zsmp2+1w559frz4+IC7j/igvJGX4KDDKUs0mlld8J2u2sBXv7CGxdzQoHaz lzVbFe7fduHbABmYz9cefQpO7wDE/Q== X-Organization: NGI0 Core X-In-Reply-To: <179502042942.2742790.17887994424282536144@gmail.com>