Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Jiping Ma <jiping.ma2@windriver.com>
To: lixiasong1@huawei.com
Cc: gregkh@linuxfoundation.org, jiping.ma2@windriver.com,
	kuba@kernel.org, matttbe@kernel.org, patches@lists.linux.dev,
	stable@vger.kernel.org, weiyongjun1@huawei.com,
	yuehaibing@huawei.com, zhangchangzhong@huawei.com
Subject: Re: [PATCH 6.12 28/70] mptcp: fix soft lockup in mptcp_recvmsg()
Date: Thu, 28 May 2026 09:52:58 +0000	[thread overview]
Message-ID: <20260528095300.810798-1-jiping.ma2@windriver.com> (raw)
In-Reply-To: <8f4eda80-bae9-4a68-b983-0acd53d2569f@huawei.com>

Thanks for your share info.

After enabling mptcp_recvmsg with dynamic_debug, I observed an infinite stream of logs:
"MPTCP: block timeout 9223372036854775807" on kernel v6.18.32 (without the fix).

In contrast, on Linux 6.12 and 6.6, the same setup only produces two such log lines, not an infinite loop.
which matches the behavior seen on v6.18.32. This indicates that the issue does not exist in Linux 6.6 and 6.12,

Thanks,
Jiping
>Also, if you want to reproduce this on `6.6.y` or `6.12.y`, based on
>the previous analysis, have the sender transmit two packets with an
>interval between them.
>
>Hope this helps.
>
>[0] Relevant dmesg log:
>Linux ubuntu 6.18.32+ #15 SMP PREEMPT_DYNAMIC Wed May 27 15:25:52 CST 2026 x86_64 x86_64 x86_64 GNU/Linux
>root@ubuntu:~# [  960.743413] watchdog: BUG: soft lockup - CPU#5 stuck for 261s! [client:1260]
>[  960.743433] Modules linked in:
>[  960.743463] CPU: 5 UID: 0 PID: 1260 Comm: client Not tainted 6.18.32+ #15 PREEMPT(none)
>[  960.743469] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
>[  960.743474] RIP: 0010:_raw_spin_lock_bh+0x1b/0x60
>[  960.743518] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 65 81 05 d0 a2 a1 01 01 02 00 00 31 c0 ba 01 00 00 00 f0 0f b1 17 <75> 1b 31 c0 31 d2 31 c9 31 f6 31 ff 45 31 c0 45 31 c9 45 31 d2 45
>[  960.743521] RSP: 0018:ffffc9000259fb08 EFLAGS: 00000246
>[  960.743524] RAX: 0000000000000000 RBX: ffff888106efc480 RCX: 0000000000000000
>[  960.743529] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff888106efc5c0
>[  960.743531] RBP: ffffc9000259fb68 R08: 0000000000000000 R09: 0000000000000000
>[  960.743533] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
>[  960.743535] R13: ffff888106efc5c0 R14: ffff888106efc528 R15: 0000000000000000
>[  960.743537] FS:  000079482a7b7740(0000) GS:ffff8881b70e7000(0000) knlGS:0000000000000000
>[  960.743540] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>[  960.743542] CR2: 00005a8d794c3008 CR3: 00000001033ea000 CR4: 00000000000006f0
>[  960.743547] Call Trace:
>[  960.743550]  <TASK>
>[  960.743552]  ? sk_wait_data+0xc2/0x1a0
>[  960.743564]  ? __pfx_woken_wake_function+0x10/0x10
>[  960.743571]  mptcp_recvmsg+0x623/0x9a0
>[  960.743578]  ? __wake_up+0x45/0x70
>[  960.743582]  inet_recvmsg+0x124/0x130
>[  960.743588]  ? apparmor_socket_recvmsg+0x25/0x40
>[  960.743595]  ? security_socket_recvmsg+0x1a9/0x1d0
>[  960.743602]  sock_recvmsg+0xb7/0xc0
>[  960.743608]  __sys_recvfrom+0xd2/0x170
>[  960.743612]  ? ksys_write+0x69/0xf0
>[  960.743618]  ? __x64_sys_write+0x19/0x30
>[  960.743622]  ? x64_sys_call+0x18fc/0x2760
>[  960.743628]  ? do_syscall_64+0xb8/0x1300
>[  960.743635]  ? do_syscall_64+0xb8/0x1300
>[  960.743640]  __x64_sys_recvfrom+0x24/0x40
>[  960.743642]  x64_sys_call+0x2694/0x2760
>[  960.743646]  do_syscall_64+0x80/0x1300
>[  960.743650]  ? count_memcg_events+0xed/0x1e0
>[  960.743655]  ? handle_mm_fault+0x210/0x2f0
>[  960.743661]  ? do_user_addr_fault+0x300/0x8d0
>[  960.743666]  ? irqentry_exit_to_user_mode+0x2e/0x330
>[  960.743670]  ? irqentry_exit+0x43/0x50
>[  960.743672]  ? exc_page_fault+0x93/0x1b0
>[  960.743675]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
>[  960.743678] RIP: 0033:0x79482a49eba6
>[  960.743691] Code: 00 00 48 8b 15 53 12 17 00 64 89 02 48 c7 c2 ff ff ff ff 48 8b 5d f8 c9 48 89 d0 c3 0f 1f 84 00 00 00 00 00 48 8b 45 10 0f 05 <48> 63 d0 3d 00 f0 ff ff 77 10 48 8b 5d f8 48 89 d0 c9 c3 0f 1f 80
>[  960.743693] RSP: 002b:00007ffd26c7bdc0 EFLAGS: 00000202 ORIG_RAX: 000000000000002d
>[  960.743696] RAX: ffffffffffffffda RBX: 000079482a7b7740 RCX: 000079482a49eba6
>[  960.743698] RDX: 0000000000000400 RSI: 00007ffd26c7be20 RDI: 0000000000000003
>[  960.743699] RBP: 00007ffd26c7bdd0 R08: 0000000000000000 R09: 0000000000000000
>[  960.743701] R10: 0000000000000102 R11: 0000000000000202 R12: 0000000000000001
>[  960.743702] R13: 0000000000000000 R14: 00005a8d75ae6d78 R15: 000079482a806000
>[  960.743707]  </TASK>
>
>> client.c
>>
>> #include <stdio.h>
>> #include <string.h>
>> #include <unistd.h>
>> #include <sys/socket.h>
>> #include <netinet/in.h>
>>
>> #define IPPROTO_MPTCP 262
>> #define PORT 9999
>>
>> int main(void) {
>>     int fd;
>>     struct sockaddr_in addr = {
>>         .sin_family = AF_INET,
>>         .sin_port = htons(PORT),
>>         .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
>>     };
>>
>>     fd = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP);
>>     if (fd < 0) {
>>         perror("socket");
>>         return 1;
>>     }
>>
>>     if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
>>         perror("connect");
>>         return 1;
>>     }
>>
>>     printf("Connected. Calling recv(MSG_PEEK | MSG_WAITALL)...\n");
>>     printf("On vulnerable 6.6 kernel, this will soft lockup a CPU.\n");
>>     printf("Monitor with: dmesg -w\n\n");
>>
>>     /*
>>      * BUG TRIGGER: MSG_PEEK | MSG_WAITALL
>>      *
>>      * - MSG_PEEK: don't remove skb from receive queue
>>      * - MSG_WAITALL: wait until buffer is full (1024 bytes)
>>      * - Server only sent 512 bytes
>>      *
>>      * Result on vulnerable kernel:
>>      *   sk_wait_data() sees data (512 bytes still in queue due to PEEK)
>>      *   → returns immediately → mptcp_recvmsg loops → never waits
>>      *   → infinite loop → soft lockup
>>      *
>>      * Fix: pass 'last' skb to sk_wait_data() so it knows
>>      *       no NEW data arrived and actually sleeps.
>>      */
>>     char buf[1024];
>>     int ret = recv(fd, buf, sizeof(buf), MSG_PEEK | MSG_WAITALL);
>>
>>     /* On patched kernel, this eventually returns or times out */
>>     printf("recv returned %d (kernel is patched or not vulnerable)\n", ret);
>>
>>     close(fd);
>>     return 0;
>> }
>>
>> server.c
>>
>> #include <stdio.h>
>> #include <string.h>
>> #include <unistd.h>
>> #include <sys/socket.h>
>> #include <netinet/in.h>
>>
>> #define IPPROTO_MPTCP 262
>> #define PORT 9999
>>
>> int main(void) {
>>     int sfd, cfd;
>>     struct sockaddr_in addr = {
>>         .sin_family = AF_INET,
>>         .sin_port = htons(PORT),
>>         .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
>>     };
>>
>>     sfd = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP);
>>     if (sfd < 0) {
>>         perror("socket (try IPPROTO_TCP if MPTCP unavailable)");
>>         return 1;
>>     }
>>
>>     int opt = 1;
>>     setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
>>     bind(sfd, (struct sockaddr *)&addr, sizeof(addr));
>>     listen(sfd, 1);
>>
>>     printf("Server listening on port %d...\n", PORT);
>>     cfd = accept(sfd, NULL, NULL);
>>     printf("Client connected.\n");
>>
>>     /* Send data so client has something to peek */
>>     char buf[512];
>>     memset(buf, 'A', sizeof(buf));
>>     write(cfd, buf, sizeof(buf));
>>     printf("Sent %zu bytes. Keeping connection open...\n", sizeof(buf));
>>
>>     /* Keep alive */
>>     sleep(600);
>>     close(cfd);
>>     close(sfd);
>>     return 0;
>> }
>>
>> Thanks,
>> Jiping
>>
>

  reply	other threads:[~2026-05-28  9:53 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 16:00 [PATCH 6.6 00/50] 6.6.135-rc1 review Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 01/50] lib/crypto: chacha: Zeroize permuted_state before it leaves scope Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 02/50] wifi: rt2x00usb: fix devres lifetime Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 03/50] xfrm_user: fix info leak in build_report() Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 04/50] net: rfkill: prevent unlimited numbers of rfkill events from being created Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 05/50] mptcp: fix slab-use-after-free in __inet_lookup_established Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 06/50] Input: uinput - fix circular locking dependency with ff-core Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 07/50] Input: uinput - take event lock when submitting FF request "event" Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 08/50] MIPS: Always record SEGBITS in cpu_data.vmbits Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 09/50] MIPS: mm: Suppress TLB uniquification on EHINV hardware Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 10/50] MIPS: mm: Rewrite TLB uniquification for the hidden bit feature Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 11/50] ASoC: simple-card-utils: Dont use __free(device_node) at graph_util_parse_dai() Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 12/50] scsi: ufs: core: Fix use-after free in init error and remove paths Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 13/50] virtio_net: clamp rss_max_key_size to NETDEV_RSS_KEY_LEN Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 14/50] mptcp: fix soft lockup in mptcp_recvmsg() Greg Kroah-Hartman
2026-04-14  1:30   ` Li Xiasong
2026-04-14 12:08     ` Sasha Levin
2026-05-27  3:05     ` [PATCH 6.12 28/70] " Jiping Ma
2026-05-27 10:22       ` Li Xiasong
2026-05-27 10:45         ` Li Xiasong
2026-05-28  9:52           ` Jiping Ma [this message]
2026-04-13 16:00 ` [PATCH 6.6 15/50] usb: gadget: f_hid: move list and spinlock inits from bind to alloc Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 16/50] Revert "mptcp: add needs_id for netlink appending addr" Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 17/50] seg6: separate dst_cache for input and output paths in seg6 lwtunnel Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 18/50] netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 19/50] Revert "drm: Fix use-after-free on framebuffers and property blobs when calling drm_dev_unplug" Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 20/50] netfilter: nft_ct: fix use-after-free in timeout object destroy Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 21/50] xfrm: clear trailing padding in build_polexpire() Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 22/50] tipc: fix bc_ackers underflow on duplicate GRP_ACK_MSG Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 23/50] wifi: brcmsmac: Fix dma_free_coherent() size Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 24/50] Revert "arm64: dts: imx8mq-librem5: Set the DVS voltages lower" Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 25/50] arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 26/50] arm64: dts: hisilicon: poplar: Correct PCIe reset GPIO polarity Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 27/50] arm64: dts: hisilicon: hi3798cv200: Add missing dma-ranges Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 28/50] nfc: pn533: allocate rx skb before consuming bytes Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 29/50] batman-adv: reject oversized global TT response buffers Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 30/50] X.509: Fix out-of-bounds access when parsing extensions Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 31/50] EDAC/mc: Fix error path ordering in edac_mc_alloc() Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.6 32/50] net/tls: fix use-after-free in -EBUSY error path of tls_do_encryption Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 33/50] net: altera-tse: fix skb leak on DMA mapping error in tse_start_xmit() Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 34/50] batman-adv: hold claim backbone gateways by reference Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 35/50] drm/i915/gt: fix refcount underflow in intel_engine_park_heartbeat Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 36/50] net/mlx5: Update the list of the PCI supported devices Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 37/50] pmdomain: imx8mp-blk-ctrl: Keep the NOC_HDCP clock enabled Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 38/50] mmc: vub300: fix NULL-deref on disconnect Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 39/50] net: qualcomm: qca_uart: report the consumed byte on RX skb allocation failure Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 40/50] net: stmmac: fix integer underflow in chain mode Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 41/50] mm: filemap: fix nr_pages calculation overflow in filemap_map_pages() Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 42/50] net: lan966x: fix page_pool error handling in lan966x_fdma_rx_alloc_page_pool() Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 43/50] rxrpc: Fix call removal to use RCU safe deletion Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 44/50] rxrpc: Fix key reference count leak from call->key Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 45/50] rxrpc: Only put the call ref if one was acquired Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 46/50] rxrpc: reject undecryptable rxkad response tickets Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 47/50] rxrpc: fix reference count leak in rxrpc_server_keyring() Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 48/50] rxrpc: Fix key/keyring checks in setsockopt(RXRPC_SECURITY_KEY/KEYRING) Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 49/50] rxrpc: Fix missing error checks for rxkad encryption/decryption failure Greg Kroah-Hartman
2026-04-13 16:01 ` [PATCH 6.6 50/50] Revert "PCI: Enable ACS after configuring IOMMU for OF platforms" Greg Kroah-Hartman
2026-04-13 17:43 ` [PATCH 6.6 00/50] 6.6.135-rc1 review Brett A C Sheffield
2026-04-13 19:14 ` Florian Fainelli
2026-04-14  7:53 ` Jon Hunter
2026-04-14  8:10 ` Pavel Machek
2026-04-14  9:30 ` Peter Schneider
2026-04-14 11:43 ` Ron Economos
2026-04-14 12:31 ` Francesco Dolcini
2026-04-14 15:01 ` Barry K. Nathan
2026-04-14 17:43 ` Shuah Khan
2026-04-14 17:48 ` Miguel Ojeda
2026-04-15  3:49 ` Shung-Hsi Yu
2026-04-15 10:16 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2026-04-13 15:59 [PATCH 6.12 00/70] 6.12.82-rc1 review Greg Kroah-Hartman
2026-04-13 16:00 ` [PATCH 6.12 28/70] mptcp: fix soft lockup in mptcp_recvmsg() Greg Kroah-Hartman
2026-04-14  1:52   ` Li Xiasong
2026-04-14 12:08     ` Sasha Levin

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=20260528095300.810798-1-jiping.ma2@windriver.com \
    --to=jiping.ma2@windriver.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=lixiasong1@huawei.com \
    --cc=matttbe@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=yuehaibing@huawei.com \
    --cc=zhangchangzhong@huawei.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