From nobody Wed Sep 17 18:02:53 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04AA419DF4A for ; Sat, 5 Jul 2025 07:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700304; cv=none; b=CH1iDeYwHJ0ONm8Y27CeN/DFbnG9fgV8DMObACAaFxlZRSmybPS/YZ83zWCmhMZeZkXsAuCRiXGkMXw1dbQ1knmuq/D1CZqsNvmpXPFBdm4JJ7v+DLMP4hjXfd+Z9rxfQbmn53LcCrbZGjTZzYenUKmUxrunhUv92oYrKQ54OmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700304; c=relaxed/simple; bh=SeHLUzs8KKNHZSzxKEjbBukauuI/e2kdK9L/9Vmgnvg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=CfeT9nsiunZfrZ6T7kAunZAza+PKVCmfEemdxDxV8pFFj8xKVBtRqD2DhovHQw4Gpht30ZGjXNUIV5QedM84NQgv7sOT94j8dw+zMTXZTEZ6QMlN0EJ1gddKmHD8KRA81k2GqLDlE8i/5xm6rDiW5MTJwgFMtXHR8+2Sd2WcPGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Gzcxww4b; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gzcxww4b" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751700300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vLyH1si+oWfnKDEBTP5aBF3msR1hNkkcpc2TJ+N9okQ=; b=Gzcxww4b/9WACgju09kgMtdvPhsiguwzKnLrNICbo4CbxD3pUqlxdEhR6gjhoLgXHI01fE 9gIs/ox39oFcuKA61IKNBqpOBQq5fEcxvIOxFb1A1kxUaaRALHqBIYDzi/16nKMckGFasU 3eMQ1y06UIMWXY0PcaTba25u8qPIhhc= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-ICmfXaghPQakSJoHe-CPtA-1; Sat, 05 Jul 2025 03:24:59 -0400 X-MC-Unique: ICmfXaghPQakSJoHe-CPtA-1 X-Mimecast-MFC-AGG-ID: ICmfXaghPQakSJoHe-CPtA_1751700298 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 316B51956086 for ; Sat, 5 Jul 2025 07:24:58 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.45.224.15]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2864D195608F for ; Sat, 5 Jul 2025 07:24:56 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v2 1/5] mptcp: make fallback action and fallback decision atomic Date: Sat, 5 Jul 2025 09:24:45 +0200 Message-ID: <7220b3c204d75d50e480f6045295a825ae80fd38.1751699999.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6ZnAY9I4H7QQoq9wVJLRRbMjjPEqBA4nhG7WuUTVqFc_1751700298 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" Syzkaller reported the following splat: WARNING: CPU: 1 PID: 7704 at net/mptcp/protocol.h:1223 __mptcp_do_fallback = net/mptcp/protocol.h:1223 [inline] WARNING: CPU: 1 PID: 7704 at net/mptcp/protocol.h:1223 mptcp_do_fallback ne= t/mptcp/protocol.h:1244 [inline] WARNING: CPU: 1 PID: 7704 at net/mptcp/protocol.h:1223 check_fully_establis= hed net/mptcp/options.c:982 [inline] WARNING: CPU: 1 PID: 7704 at net/mptcp/protocol.h:1223 mptcp_incoming_optio= ns+0x21a8/0x2510 net/mptcp/options.c:1153 Modules linked in: CPU: 1 UID: 0 PID: 7704 Comm: syz.3.1419 Not tainted 6.16.0-rc3-gbd5ce2324d= ba #20 PREEMPT(voluntary) Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debi= an-1.16.3-2 04/01/2014 RIP: 0010:__mptcp_do_fallback net/mptcp/protocol.h:1223 [inline] RIP: 0010:mptcp_do_fallback net/mptcp/protocol.h:1244 [inline] RIP: 0010:check_fully_established net/mptcp/options.c:982 [inline] RIP: 0010:mptcp_incoming_options+0x21a8/0x2510 net/mptcp/options.c:1153 Code: 24 18 e8 bb 2a 00 fd e9 1b df ff ff e8 b1 21 0f 00 e8 ec 5f c4 fc 44 = 0f b7 ac 24 b0 00 00 00 e9 54 f1 ff ff e8 d9 5f c4 fc 90 <0f> 0b 90 e9 b8 f= 4 ff ff e8 8b 2a 00 fd e9 8d e6 ff ff e8 81 2a 00 RSP: 0018:ffff8880a3f08448 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8880180a8000 RCX: ffffffff84afcf45 RDX: ffff888090223700 RSI: ffffffff84afdaa7 RDI: 0000000000000001 RBP: ffff888017955780 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8880180a8910 R14: ffff8880a3e9d058 R15: 0000000000000000 FS: 00005555791b8500(0000) GS:ffff88811c495000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000110c2800b7 CR3: 0000000058e44000 CR4: 0000000000350ef0 Call Trace: tcp_reset+0x26f/0x2b0 net/ipv4/tcp_input.c:4432 tcp_validate_incoming+0x1057/0x1b60 net/ipv4/tcp_input.c:5975 tcp_rcv_established+0x5b5/0x21f0 net/ipv4/tcp_input.c:6166 tcp_v4_do_rcv+0x5dc/0xa70 net/ipv4/tcp_ipv4.c:1925 tcp_v4_rcv+0x3473/0x44a0 net/ipv4/tcp_ipv4.c:2363 ip_protocol_deliver_rcu+0xba/0x480 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2f1/0x500 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:317 [inline] NF_HOOK include/linux/netfilter.h:311 [inline] ip_local_deliver+0x1be/0x560 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:469 [inline] ip_rcv_finish net/ipv4/ip_input.c:447 [inline] NF_HOOK include/linux/netfilter.h:317 [inline] NF_HOOK include/linux/netfilter.h:311 [inline] ip_rcv+0x514/0x810 net/ipv4/ip_input.c:567 __netif_receive_skb_one_core+0x197/0x1e0 net/core/dev.c:5975 __netif_receive_skb+0x1f/0x120 net/core/dev.c:6088 process_backlog+0x301/0x1360 net/core/dev.c:6440 __napi_poll.constprop.0+0xba/0x550 net/core/dev.c:7453 napi_poll net/core/dev.c:7517 [inline] net_rx_action+0xb44/0x1010 net/core/dev.c:7644 handle_softirqs+0x1d0/0x770 kernel/softirq.c:579 do_softirq+0x3f/0x90 kernel/softirq.c:480 __local_bh_enable_ip+0xed/0x110 kernel/softirq.c:407 local_bh_enable include/linux/bottom_half.h:33 [inline] inet_csk_listen_stop+0x2c5/0x1070 net/ipv4/inet_connection_sock.c:1524 mptcp_check_listen_stop.part.0+0x1cc/0x220 net/mptcp/protocol.c:2985 mptcp_check_listen_stop net/mptcp/mib.h:118 [inline] __mptcp_close+0x9b9/0xbd0 net/mptcp/protocol.c:3000 mptcp_close+0x2f/0x140 net/mptcp/protocol.c:3066 inet_release+0xed/0x200 net/ipv4/af_inet.c:435 inet6_release+0x4f/0x70 net/ipv6/af_inet6.c:487 __sock_release+0xb3/0x270 net/socket.c:649 sock_close+0x1c/0x30 net/socket.c:1439 __fput+0x402/0xb70 fs/file_table.c:465 task_work_run+0x150/0x240 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xd4/0xe0 kernel/entry/common.c:114 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline] do_syscall_64+0x245/0x360 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc92f8a36ad Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 = 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff f= f 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffcf52802d8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007ffcf52803a8 RCX: 00007fc92f8a36ad RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007fc92fae7ba0 R08: 0000000000000001 R09: 0000002800000000 R10: 00007fc92f700000 R11: 0000000000000246 R12: 00007fc92fae5fac R13: 00007fc92fae5fa0 R14: 0000000000026d00 R15: 0000000000026c51 irq event stamp: 4068 hardirqs last enabled at (4076): [] __up_console_sem+0x7= 6/0x80 kernel/printk/printk.c:344 hardirqs last disabled at (4085): [] __up_console_sem+0x5= b/0x80 kernel/printk/printk.c:342 softirqs last enabled at (3096): [] local_bh_enable incl= ude/linux/bottom_half.h:33 [inline] softirqs last enabled at (3096): [] inet_csk_listen_stop= +0x2c0/0x1070 net/ipv4/inet_connection_sock.c:1524 softirqs last disabled at (3097): [] do_softirq+0x3f/0x90= kernel/softirq.c:480 Since we need to track the 'fallback is possible' condition and the fallback status separately, there are a few possible races open between the check and the actual fallback action. Add a spinlock to protect the fallback related information and use it close all the possible related races. While at it also remove the too-early clearing of allow_infinite_fallback in __mptcp_subflow_connect(): the field will be correctly cleared by subflow_finish_connect() if/ when the connection will complete successfully. If fallback is not possible, as per RFC, reset the current subflow. Reported by: Matthieu Baerts Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/570 Reported-by: syzbot+5cf807c20386d699b524@syzkaller.appspotmail.com Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/555 Fixes: 0530020a7c8f ("mptcp: track and update contiguous data status") Signed-off-by: Paolo Abeni --- v1 -> v2: - remove unneeded and racing allow_infinite_fallback in __mptcp_subflow_connect() - really close race in subflow_check_data_avail() Sharing earlier to feed syzkaller. Hopefully a follow-up on mptcp-net-next will cleanup a bit the fallback handling, I tried to minimize the delta for backport's sake --- net/mptcp/options.c | 3 ++- net/mptcp/protocol.c | 40 +++++++++++++++++++++++++++++++++++----- net/mptcp/protocol.h | 21 +++++++++++++++------ net/mptcp/subflow.c | 8 ++++---- 4 files changed, 56 insertions(+), 16 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 56fd7bcb786c..4680d980e605 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -978,8 +978,9 @@ static bool check_fully_established(struct mptcp_sock *= msk, struct sock *ssk, if (subflow->mp_join) goto reset; subflow->mp_capable =3D 0; + if (mptcp_do_fallback(ssk)) + goto reset; pr_fallback(msk); - mptcp_do_fallback(ssk); return false; } =20 diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1de42dc4e8ea..38bb11865b50 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -560,10 +560,9 @@ static bool mptcp_check_data_fin(struct sock *sk) =20 static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk) { - if (READ_ONCE(msk->allow_infinite_fallback)) { + if (mptcp_do_fallback(ssk)) { MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCORRUPTIONFALLBACK); - mptcp_do_fallback(ssk); } else { MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCORRUPTIONRESET); mptcp_subflow_reset(ssk); @@ -803,6 +802,14 @@ static bool __mptcp_finish_join(struct mptcp_sock *msk= , struct sock *ssk) if (sk->sk_state !=3D TCP_ESTABLISHED) return false; =20 + spin_lock_bh(&msk->fallback_lock); + if (__mptcp_check_fallback(msk)) { + spin_unlock_bh(&msk->fallback_lock); + return false; + } + mptcp_subflow_joined(msk, ssk); + spin_unlock_bh(&msk->fallback_lock); + /* attach to msk socket only after we are sure we will deal with it * at close time */ @@ -811,7 +818,6 @@ static bool __mptcp_finish_join(struct mptcp_sock *msk,= struct sock *ssk) =20 mptcp_subflow_ctx(ssk)->subflow_id =3D msk->subflow_id++; mptcp_sockopt_sync_locked(msk, ssk); - mptcp_subflow_joined(msk, ssk); mptcp_stop_tout_timer(sk); __mptcp_propagate_sndbuf(sk, ssk); return true; @@ -1136,10 +1142,14 @@ static void mptcp_update_infinite_map(struct mptcp_= sock *msk, mpext->infinite_map =3D 1; mpext->data_len =3D 0; =20 + if (!mptcp_do_fallback(ssk)) { + mptcp_subflow_reset(ssk); + return; + } + MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPTX); mptcp_subflow_ctx(ssk)->send_infinite_map =3D 0; pr_fallback(msk); - mptcp_do_fallback(ssk); } =20 #define MPTCP_MAX_GSO_SIZE (GSO_LEGACY_MAX_SIZE - (MAX_TCP_HEADER + 1)) @@ -2543,9 +2553,9 @@ static void mptcp_check_fastclose(struct mptcp_sock *= msk) =20 static void __mptcp_retrans(struct sock *sk) { + struct mptcp_sendmsg_info info =3D { .data_lock_held =3D true, }; struct mptcp_sock *msk =3D mptcp_sk(sk); struct mptcp_subflow_context *subflow; - struct mptcp_sendmsg_info info =3D {}; struct mptcp_data_frag *dfrag; struct sock *ssk; int ret, err; @@ -2590,6 +2600,18 @@ static void __mptcp_retrans(struct sock *sk) info.sent =3D 0; info.limit =3D READ_ONCE(msk->csum_enabled) ? dfrag->data_len : dfrag->already_sent; + + /* + * make the whole retrans decision, xmit, disallow + * fallback atomic + */ + spin_lock_bh(&msk->fallback_lock); + if (__mptcp_check_fallback(msk)) { + spin_unlock_bh(&msk->fallback_lock); + release_sock(ssk); + return; + } + while (info.sent < info.limit) { ret =3D mptcp_sendmsg_frag(sk, ssk, dfrag, &info); if (ret <=3D 0) @@ -2605,6 +2627,7 @@ static void __mptcp_retrans(struct sock *sk) info.size_goal); WRITE_ONCE(msk->allow_infinite_fallback, false); } + spin_unlock_bh(&msk->fallback_lock); =20 release_sock(ssk); } @@ -2738,6 +2761,7 @@ static void __mptcp_init_sock(struct sock *sk) msk->last_ack_recv =3D tcp_jiffies32; =20 mptcp_pm_data_init(msk); + spin_lock_init(&msk->fallback_lock); =20 /* re-use the csk retrans timer for MPTCP-level retrans */ timer_setup(&msk->sk.icsk_retransmit_timer, mptcp_retransmit_timer, 0); @@ -3524,7 +3548,13 @@ bool mptcp_finish_join(struct sock *ssk) =20 /* active subflow, already present inside the conn_list */ if (!list_empty(&subflow->node)) { + spin_lock_bh(&msk->fallback_lock); + if (__mptcp_check_fallback(msk)) { + spin_unlock_bh(&msk->fallback_lock); + return false; + } mptcp_subflow_joined(msk, ssk); + spin_unlock_bh(&msk->fallback_lock); mptcp_propagate_sndbuf(parent, ssk); return true; } diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index e36ae88b10ad..52c9175c7e49 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -352,6 +352,7 @@ struct mptcp_sock { u32 subflow_id; u32 setsockopt_seq; char ca_name[TCP_CA_NAME_MAX]; + spinlock_t fallback_lock; /* protects fallback && allow_infinite_fallback= */ }; =20 #define mptcp_data_lock(sk) spin_lock_bh(&(sk)->sk_lock.slock) @@ -1214,15 +1215,21 @@ static inline bool mptcp_check_fallback(const struc= t sock *sk) return __mptcp_check_fallback(msk); } =20 -static inline void __mptcp_do_fallback(struct mptcp_sock *msk) +static inline bool __mptcp_do_fallback(struct mptcp_sock *msk) { if (__mptcp_check_fallback(msk)) { pr_debug("TCP fallback already done (msk=3D%p)\n", msk); - return; + return true; } - if (WARN_ON_ONCE(!READ_ONCE(msk->allow_infinite_fallback))) - return; + spin_lock_bh(&msk->fallback_lock); + if (!msk->allow_infinite_fallback) { + spin_unlock_bh(&msk->fallback_lock); + return false; + } + set_bit(MPTCP_FALLBACK_DONE, &msk->flags); + spin_unlock_bh(&msk->fallback_lock); + return true; } =20 static inline bool __mptcp_has_initial_subflow(const struct mptcp_sock *ms= k) @@ -1234,14 +1241,15 @@ static inline bool __mptcp_has_initial_subflow(cons= t struct mptcp_sock *msk) TCPF_SYN_RECV | TCPF_LISTEN)); } =20 -static inline void mptcp_do_fallback(struct sock *ssk) +static inline bool mptcp_do_fallback(struct sock *ssk) { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(ssk); struct sock *sk =3D subflow->conn; struct mptcp_sock *msk; =20 msk =3D mptcp_sk(sk); - __mptcp_do_fallback(msk); + if (!__mptcp_do_fallback(msk)) + return false; if (READ_ONCE(msk->snd_data_fin_enable) && !(ssk->sk_shutdown & SEND_SHUT= DOWN)) { gfp_t saved_allocation =3D ssk->sk_allocation; =20 @@ -1253,6 +1261,7 @@ static inline void mptcp_do_fallback(struct sock *ssk) tcp_shutdown(ssk, SEND_SHUTDOWN); ssk->sk_allocation =3D saved_allocation; } + return true; } =20 #define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)\n", __func_= _, a) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 15613d691bfe..433c0b25dbc1 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -544,9 +544,11 @@ static void subflow_finish_connect(struct sock *sk, co= nst struct sk_buff *skb) mptcp_get_options(skb, &mp_opt); if (subflow->request_mptcp) { if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_SYNACK)) { + if (!mptcp_do_fallback(sk)) + goto do_reset; + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPCAPABLEACTIVEFALLBACK); - mptcp_do_fallback(sk); pr_fallback(msk); goto fallback; } @@ -1395,7 +1397,7 @@ static bool subflow_check_data_avail(struct sock *ssk) return true; } =20 - if (!READ_ONCE(msk->allow_infinite_fallback)) { + if (!mptcp_do_fallback(ssk)) { /* fatal protocol error, close the socket. * subflow_error_report() will introduce the appropriate barriers */ @@ -1414,7 +1416,6 @@ static bool subflow_check_data_avail(struct sock *ssk) return false; } =20 - mptcp_do_fallback(ssk); } =20 skb =3D skb_peek(&ssk->sk_receive_queue); @@ -1679,7 +1680,6 @@ int __mptcp_subflow_connect(struct sock *sk, const st= ruct mptcp_pm_local *local, /* discard the subflow socket */ mptcp_sock_graft(ssk, sk->sk_socket); iput(SOCK_INODE(sf)); - WRITE_ONCE(msk->allow_infinite_fallback, false); mptcp_stop_tout_timer(sk); return 0; =20 --=20 2.49.0 From nobody Wed Sep 17 18:02:53 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A4D81F5437 for ; Sat, 5 Jul 2025 07:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700305; cv=none; b=XFObNvnoa3AZbCBxs0RG8oBWgZrK1kDGiSN52hcRpDLDAkodaB7Lld/To0kpgJGjwoBXuAu5rHxAkNljx6RH3XJfhDSHXexPe4AhL8Cc+A/dNFSmRG8eKjY3LUKGya+UtJXHqp2n4viUas7O/ewS4VKyPVKQlnTqaTuv3lIgeWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700305; c=relaxed/simple; bh=Th1wFGdlrJsFLZ3es8KiOLUjIZW90KhDFsIgtAX0QIY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=tiUIS67o4JKBCrzFd/4nQ1jcG/EPRmwIc/0WdLqT/IALuih+6xGHIWYz7/k0ygdYOV4iuyfn7M35v1fOt8muhWz35FxTtGXUz/2k3uMUzfhkYH3q/GFLWaRLk6c4llKcl0JV1jMOoes+w6RlB7EWHM93pjcOBBb6l89E6he2ums= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CBDUz6XU; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CBDUz6XU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751700302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EN++SHlD73tYBXizf9Yp/31N6lmO7gxSNtheTbPPzUA=; b=CBDUz6XUDBFhSa1at6wP7d6x8/4SWG9NGLBjK6zlMd2M70bjVWY+XjEF5xz/7KesyqFWQH rjNb+mtoo1fl2NIRpqFLoXpbJ/0NpJ7MRRDAGkrROgwmIFW/b2ADPw8AttoMc2i1K4AILo EUuyVImG24vVcM41bCACx13qIoXjP0s= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-nyv4BjTnOUK1HPW6GhV_lQ-1; Sat, 05 Jul 2025 03:25:00 -0400 X-MC-Unique: nyv4BjTnOUK1HPW6GhV_lQ-1 X-Mimecast-MFC-AGG-ID: nyv4BjTnOUK1HPW6GhV_lQ_1751700300 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A1DB11956061 for ; Sat, 5 Jul 2025 07:24:59 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.45.224.15]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9B7E2195608F for ; Sat, 5 Jul 2025 07:24:58 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v2 2/5] mptcp: plug races between subflow fail and subflow creation Date: Sat, 5 Jul 2025 09:24:46 +0200 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: RV1stLtO7IeqMG6eXt9UlLDwSyuSxJ6YbNCS3FM7U3Y_1751700300 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" We have races similar to the one addressed by the previous patch between subflow failing and additional subflow creation. They are just harder to trigger. The solution is similar. Use a separate flag to track the condition 'socket state prevent any additional subflow creation' protected by the fallback lock. The socket fallback makes such flag true, and also receiving or sending a MPTCP fail option. The field 'allow_infinite_fallback' is now always touched under the relevant lock, we can drop the ONCE annotation on write. Fixes: 478d770008b0 ("mptcp: send out MP_FAIL when data checksum fails") Signed-off-by: Paolo Abeni --- net/mptcp/pm.c | 8 +++++++- net/mptcp/protocol.c | 11 ++++++----- net/mptcp/protocol.h | 8 +++++++- net/mptcp/subflow.c | 19 ++++++++++++++----- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 25ce2d5135bc..687dbb59d084 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -765,8 +765,14 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fa= il_seq) =20 pr_debug("fail_seq=3D%llu\n", fail_seq); =20 - if (!READ_ONCE(msk->allow_infinite_fallback)) + /* After accepting the fail, we can't create any other subflows */ + spin_lock_bh(&msk->fallback_lock); + if (!msk->allow_infinite_fallback) { + spin_unlock_bh(&msk->fallback_lock); return; + } + msk->allow_subflows =3D false; + spin_unlock_bh(&msk->fallback_lock); =20 if (!subflow->fail_tout) { pr_debug("send MP_FAIL response and infinite map\n"); diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 38bb11865b50..71b258aebcd9 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -791,7 +791,7 @@ void mptcp_data_ready(struct sock *sk, struct sock *ssk) static void mptcp_subflow_joined(struct mptcp_sock *msk, struct sock *ssk) { mptcp_subflow_ctx(ssk)->map_seq =3D READ_ONCE(msk->ack_seq); - WRITE_ONCE(msk->allow_infinite_fallback, false); + msk->allow_infinite_fallback =3D false; mptcp_event(MPTCP_EVENT_SUB_ESTABLISHED, msk, ssk, GFP_ATOMIC); } =20 @@ -803,7 +803,7 @@ static bool __mptcp_finish_join(struct mptcp_sock *msk,= struct sock *ssk) return false; =20 spin_lock_bh(&msk->fallback_lock); - if (__mptcp_check_fallback(msk)) { + if (!msk->allow_subflows) { spin_unlock_bh(&msk->fallback_lock); return false; } @@ -2625,7 +2625,7 @@ static void __mptcp_retrans(struct sock *sk) len =3D max(copied, len); tcp_push(ssk, 0, info.mss_now, tcp_sk(ssk)->nonagle, info.size_goal); - WRITE_ONCE(msk->allow_infinite_fallback, false); + msk->allow_infinite_fallback =3D false; } spin_unlock_bh(&msk->fallback_lock); =20 @@ -2753,7 +2753,8 @@ static void __mptcp_init_sock(struct sock *sk) WRITE_ONCE(msk->first, NULL); inet_csk(sk)->icsk_sync_mss =3D mptcp_sync_mss; WRITE_ONCE(msk->csum_enabled, mptcp_is_checksum_enabled(sock_net(sk))); - WRITE_ONCE(msk->allow_infinite_fallback, true); + msk->allow_infinite_fallback =3D true; + msk->allow_subflows =3D true; msk->recovery =3D false; msk->subflow_id =3D 1; msk->last_data_sent =3D tcp_jiffies32; @@ -3549,7 +3550,7 @@ bool mptcp_finish_join(struct sock *ssk) /* active subflow, already present inside the conn_list */ if (!list_empty(&subflow->node)) { spin_lock_bh(&msk->fallback_lock); - if (__mptcp_check_fallback(msk)) { + if (!msk->allow_subflows) { spin_unlock_bh(&msk->fallback_lock); return false; } diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 52c9175c7e49..34c0863f1eae 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -348,11 +348,16 @@ struct mptcp_sock { u64 rtt_us; /* last maximum rtt of subflows */ } rcvq_space; u8 scaling_ratio; + bool allow_subflows; =20 u32 subflow_id; u32 setsockopt_seq; char ca_name[TCP_CA_NAME_MAX]; - spinlock_t fallback_lock; /* protects fallback && allow_infinite_fallback= */ + + spinlock_t fallback_lock; /* protects fallback, + * allow_infinite_fallback and + * allow_join + */ }; =20 #define mptcp_data_lock(sk) spin_lock_bh(&(sk)->sk_lock.slock) @@ -1227,6 +1232,7 @@ static inline bool __mptcp_do_fallback(struct mptcp_s= ock *msk) return false; } =20 + msk->allow_subflows =3D false; set_bit(MPTCP_FALLBACK_DONE, &msk->flags); spin_unlock_bh(&msk->fallback_lock); return true; diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 433c0b25dbc1..11c5b042c2e1 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1302,20 +1302,29 @@ static void subflow_sched_work_if_closed(struct mpt= cp_sock *msk, struct sock *ss mptcp_schedule_work(sk); } =20 -static void mptcp_subflow_fail(struct mptcp_sock *msk, struct sock *ssk) +static bool mptcp_subflow_fail(struct mptcp_sock *msk, struct sock *ssk) { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(ssk); unsigned long fail_tout; =20 + /* we are really failing, prevent any later subflow join */ + spin_lock_bh(&msk->fallback_lock); + if (!msk->allow_infinite_fallback) { + spin_unlock_bh(&msk->fallback_lock); + return false; + } + msk->allow_subflows =3D false; + spin_unlock_bh(&msk->fallback_lock); + /* graceful failure can happen only on the MPC subflow */ if (WARN_ON_ONCE(ssk !=3D READ_ONCE(msk->first))) - return; + return false; =20 /* since the close timeout take precedence on the fail one, * no need to start the latter when the first is already set */ if (sock_flag((struct sock *)msk, SOCK_DEAD)) - return; + return true; =20 /* we don't need extreme accuracy here, use a zero fail_tout as special * value meaning no fail timeout at all; @@ -1327,6 +1336,7 @@ static void mptcp_subflow_fail(struct mptcp_sock *msk= , struct sock *ssk) tcp_send_ack(ssk); =20 mptcp_reset_tout_timer(msk, subflow->fail_tout); + return true; } =20 static bool subflow_check_data_avail(struct sock *ssk) @@ -1387,12 +1397,11 @@ static bool subflow_check_data_avail(struct sock *s= sk) (subflow->mp_join || subflow->valid_csum_seen)) { subflow->send_mp_fail =3D 1; =20 - if (!READ_ONCE(msk->allow_infinite_fallback)) { + if (!mptcp_subflow_fail(msk, ssk)) { subflow->reset_transient =3D 0; subflow->reset_reason =3D MPTCP_RST_EMIDDLEBOX; goto reset; } - mptcp_subflow_fail(msk, ssk); WRITE_ONCE(subflow->data_avail, true); return true; } --=20 2.49.0 From nobody Wed Sep 17 18:02:53 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 402F41E832A for ; Sat, 5 Jul 2025 07:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700306; cv=none; b=PGbj1XSZ+0t2iDA0fwYvhdeTUoVhH1VN7lnWYnprrt/18A+ffOSjlAdRw13W8VoKt8xlppWwT32wkOjU1i8lZJeOMAffA9GsovF+o5pZSZ5FwGIoxeuPrhf1m/gBdHaU68dDv5I0L2yuyHqcHtbNQyVwuqgmYZQ2eIQFkqPKtsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700306; c=relaxed/simple; bh=3UdE8nDz3yKO0TcLJyjWu5fI513RkG85kFPLaJGW6xk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=NB3leAuRQUnzRxH92ZBmXnpu4JoEykm57DEi/hCcHQNkpBvHXXXagh7tODYmlVi3bZHasrzgz4szdU0ZmLUsjar5IMepkTTgMiPvWH6QUXr/EYjEM4yci36DA85TSQTgckW6BL6s+Wz0XlT9Hi8qcl5d1Yx1523rQZFaPzmFdls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OQ037hXM; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OQ037hXM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751700304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M/UJZt6eXZ3rLt6LaHP+FnToEe+9sEyt3IfRaOO1lgw=; b=OQ037hXMDhpBlOAAIKKP8V9CPvd23em8GkHHdFSFBxGGMpIjmbsdyVgYOGZS1jbK6Nr3Hx Y0ZAUTi6V8ijyG/UTVhgK6S1fFiho+ABqRzp52NeMJfavoPkUXzycGWStTZKbQdlnk99Vg 8uPQ30hzfl62f/CxVHxNbitoC+mkUpo= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-aWxjGGHSMVqPe_8owPiVnA-1; Sat, 05 Jul 2025 03:25:02 -0400 X-MC-Unique: aWxjGGHSMVqPe_8owPiVnA-1 X-Mimecast-MFC-AGG-ID: aWxjGGHSMVqPe_8owPiVnA_1751700301 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 24A9E1944A82 for ; Sat, 5 Jul 2025 07:25:01 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.45.224.15]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1961B195608F for ; Sat, 5 Jul 2025 07:24:59 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v2 3/5] mptcp: fix status reset on disconnect() Date: Sat, 5 Jul 2025 09:24:47 +0200 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DzUb2iOHgC9Ub4FONNuWDQUm-t6Leu-Ghc3q8Ou-gHc_1751700301 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" disconnect() can still race with subflow fallback leaving the msk in inconsistent status. To avoid such race, disconnect() must be blocking, error out if the argument prevent such wait: the socket will linger in SS_DISCONNECT state forever. Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation") Signed-off-by: Paolo Abeni --- net/mptcp/protocol.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 71b258aebcd9..0dc55a17f274 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3119,8 +3119,19 @@ static void mptcp_copy_inaddrs(struct sock *msk, con= st struct sock *ssk) inet_sk(msk)->inet_rcv_saddr =3D inet_sk(ssk)->inet_rcv_saddr; } =20 +/* can safely clear the fallback status only if no subflow is going to + * push or receive any data on the wire + */ +static bool mptcp_can_reset_fb_status(const struct mptcp_sock *msk) +{ + return list_empty(&msk->conn_list) || + inet_sk_state_load(msk->first) =3D=3D TCP_CLOSE; +} + static int mptcp_disconnect(struct sock *sk, int flags) { + long timeout =3D sock_sndtimeo(sk, flags & MSG_DONTWAIT); + DEFINE_WAIT_FUNC(wait, woken_wake_function); struct mptcp_sock *msk =3D mptcp_sk(sk); =20 /* We are on the fastopen error path. We can't call straight into the @@ -3142,7 +3153,34 @@ static int mptcp_disconnect(struct sock *sk, int fla= gs) * subflow */ mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE); + + if (!mptcp_can_reset_fb_status(msk)) { + if (!timeout) + return -EAGAIN; + + add_wait_queue(sk_sleep(sk), &wait); + + /* __mptcp_close_ssk() will wake us */ + do { + if (sk_wait_event(sk, &timeout, + mptcp_can_reset_fb_status(msk), + &wait)) + break; + } while (!signal_pending(current) && timeout); + + remove_wait_queue(sk_sleep(sk), &wait); + + /* timeout/signal can prevent reaching the expected status */ + if (!mptcp_can_reset_fb_status(msk)) + return -EBUSY; + } + + spin_lock_bh(&msk->fallback_lock); + msk->allow_subflows =3D true; + msk->allow_infinite_fallback =3D true; WRITE_ONCE(msk->flags, 0); + spin_unlock_bh(&msk->fallback_lock); + msk->cb_flags =3D 0; msk->recovery =3D false; WRITE_ONCE(msk->can_ack, false); --=20 2.49.0 From nobody Wed Sep 17 18:02:53 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E81451F5437 for ; Sat, 5 Jul 2025 07:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700308; cv=none; b=MQ5ZygIADnzx9Yhc2c6rEy1wuUFJUzsYx7n7aTiWpuCvqH2khbR3dmz9+zF47onuWMBMugYynNvP75TCO1k+fPN6t/D8l63XWGTr4+yaYafGI3NsuPg41vdLrgD/qJrjI3kzVJ9jYlSrhMQm8Hm+gO9ORQBcg7hDaBocEHhiwWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700308; c=relaxed/simple; bh=vhbvzGIYvhzcP6qUzmEz3xWJbnbOm8rty53rfPySuYE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=hulBpsMs4e85GFQ2+s3VfquZWnjeOIo4z3KfNOqdKeCO2CwDWlGX+uykk4ImWmOB3VIVjip3Pd6AyLdfQMM9sxEa3R+MqtL3eTkW0ViVy7HebtuBzF7CtuIXKtuGCpVY/fYkbH8fb/ZnFP7xB+6Ias8VO2WiviPlRb9E3bg/sc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GpmGbtfj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GpmGbtfj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751700305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k1cyhGHEe+VQG6AFV5nE7OVzIwdDh8dvFRQuofcRk90=; b=GpmGbtfjPygT2r7mH8T6Svp0DsxN2x7HzodTGcSQTuo6fOOdCwixfWCKCRVn0KU3pUizrg soeaML4m4QxmoB5Xwzuh0XQ/OsnF7+ZR38Bt+k14aOzBkR6F1p13bXG8yWnkQyO2UypGf0 rPnbBE8sP2i3r/DHzl6yrA4+l4YfCeI= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-108-IGZ4gWDlNl26fUUEVKuPXw-1; Sat, 05 Jul 2025 03:25:04 -0400 X-MC-Unique: IGZ4gWDlNl26fUUEVKuPXw-1 X-Mimecast-MFC-AGG-ID: IGZ4gWDlNl26fUUEVKuPXw_1751700302 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8A435180029F for ; Sat, 5 Jul 2025 07:25:02 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.45.224.15]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AD935195608F for ; Sat, 5 Jul 2025 07:25:01 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v2 4/5] mptcp: track fallbacks accurately via mibs Date: Sat, 5 Jul 2025 09:24:48 +0200 Message-ID: <5a78b3e0fc95d2f6356ff4754ec3bdf1dcf6b2cc.1751700000.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JlxVx-_69R0Wl2ikV2QXodCsu7xfDeKTsvXPKkKw0Q8_1751700302 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" Add the mibs required to cover the few possible fallback causes still lacking suck info. Move the relevant mib increment into the fallback helper, so that no eventual future fallback operation will miss a paired mib increment. Additionally track failed fallback via its own mib. While at the above, rename an existing helper to reduce long lines problems all along. Signed-off-by: Paolo Abeni --- still a couple of long lines I could not trim --- net/mptcp/ctrl.c | 4 ++-- net/mptcp/mib.c | 5 +++++ net/mptcp/mib.h | 7 +++++++ net/mptcp/options.c | 2 +- net/mptcp/protocol.c | 44 ++++++++++++++++++++++++++++++-------------- net/mptcp/protocol.h | 31 ++++++++----------------------- net/mptcp/subflow.c | 10 ++++------ 7 files changed, 57 insertions(+), 46 deletions(-) diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c index d9290c5bb6c7..fed40dae5583 100644 --- a/net/mptcp/ctrl.c +++ b/net/mptcp/ctrl.c @@ -533,9 +533,9 @@ void mptcp_active_detect_blackhole(struct sock *ssk, bo= ol expired) to_max =3D mptcp_get_pernet(net)->syn_retrans_before_tcp_fallback; =20 if (timeouts =3D=3D to_max || (timeouts < to_max && expired)) { - MPTCP_INC_STATS(net, MPTCP_MIB_MPCAPABLEACTIVEDROP); subflow->mpc_drop =3D 1; - mptcp_subflow_early_fallback(mptcp_sk(subflow->conn), subflow); + mptcp_early_fallback(mptcp_sk(subflow->conn), subflow, + MPTCP_MIB_MPCAPABLEACTIVEDROP); } } =20 diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c index 0c24545f0e8d..064f5eaf0595 100644 --- a/net/mptcp/mib.c +++ b/net/mptcp/mib.c @@ -80,6 +80,11 @@ static const struct snmp_mib mptcp_snmp_list[] =3D { SNMP_MIB_ITEM("RcvWndConflict", MPTCP_MIB_RCVWNDCONFLICT), SNMP_MIB_ITEM("MPCurrEstab", MPTCP_MIB_CURRESTAB), SNMP_MIB_ITEM("Blackhole", MPTCP_MIB_BLACKHOLE), + SNMP_MIB_ITEM("DataFallback", MPTCP_MIB_DATA_FALLBACK), + SNMP_MIB_ITEM("MD5sumFallback", MPTCP_MIB_MD5SUM_FALLBACK), + SNMP_MIB_ITEM("DssFallback", MPTCP_MIB_DSS_FALLBACK), + SNMP_MIB_ITEM("SimultFallback", MPTCP_MIB_SIMULT_FALLBACK), + SNMP_MIB_ITEM("FallbackFailed", MPTCP_MIB_FALLBACK_FAILED), SNMP_MIB_SENTINEL }; =20 diff --git a/net/mptcp/mib.h b/net/mptcp/mib.h index 250c6b77977e..99c8788694c3 100644 --- a/net/mptcp/mib.h +++ b/net/mptcp/mib.h @@ -81,6 +81,13 @@ enum linux_mptcp_mib_field { MPTCP_MIB_RCVWNDCONFLICT, /* Conflict with while updating msk rcv wnd */ MPTCP_MIB_CURRESTAB, /* Current established MPTCP connections */ MPTCP_MIB_BLACKHOLE, /* A blackhole has been detected */ + MPTCP_MIB_DATA_FALLBACK, /* Missing DSS/MPC+data on first + * established packet + */ + MPTCP_MIB_MD5SUM_FALLBACK, /* Conflicting TCP option enabled */ + MPTCP_MIB_DSS_FALLBACK, /* Bad or missing DSS */ + MPTCP_MIB_SIMULT_FALLBACK, /* Simultaneous connect */ + MPTCP_MIB_FALLBACK_FAILED, /* Can't fallback due to msk status */ __MPTCP_MIB_MAX }; =20 diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 4680d980e605..c9e1f3ec3772 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -978,7 +978,7 @@ static bool check_fully_established(struct mptcp_sock *= msk, struct sock *ssk, if (subflow->mp_join) goto reset; subflow->mp_capable =3D 0; - if (mptcp_do_fallback(ssk)) + if (mptcp_do_fallback(ssk, MPTCP_MIB_DATA_FALLBACK)) goto reset; pr_fallback(msk); return false; diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 0dc55a17f274..5f99f02c827c 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -67,6 +67,27 @@ static const struct proto_ops *mptcp_fallback_tcp_ops(co= nst struct sock *sk) return &inet_stream_ops; } =20 +bool __mptcp_do_fallback(struct mptcp_sock *msk, int fb_mib) +{ + struct net *net =3D sock_net((struct sock *)msk); + + if (__mptcp_check_fallback(msk)) + return true; + + spin_lock_bh(&msk->fallback_lock); + if (!msk->allow_infinite_fallback) { + __MPTCP_INC_STATS(net, MPTCP_MIB_SIMULT_FALLBACK); + spin_unlock_bh(&msk->fallback_lock); + return false; + } + + msk->allow_subflows =3D false; + set_bit(MPTCP_FALLBACK_DONE, &msk->flags); + __MPTCP_INC_STATS(net, fb_mib); + spin_unlock_bh(&msk->fallback_lock); + return true; +} + static int __mptcp_socket_create(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow; @@ -560,10 +581,7 @@ static bool mptcp_check_data_fin(struct sock *sk) =20 static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk) { - if (mptcp_do_fallback(ssk)) { - MPTCP_INC_STATS(sock_net(ssk), - MPTCP_MIB_DSSCORRUPTIONFALLBACK); - } else { + if (!mptcp_do_fallback(ssk, MPTCP_MIB_DSSCORRUPTIONFALLBACK)) { MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCORRUPTIONRESET); mptcp_subflow_reset(ssk); } @@ -1142,12 +1160,11 @@ static void mptcp_update_infinite_map(struct mptcp_= sock *msk, mpext->infinite_map =3D 1; mpext->data_len =3D 0; =20 - if (!mptcp_do_fallback(ssk)) { + if (!mptcp_do_fallback(ssk, MPTCP_MIB_INFINITEMAPTX)) { mptcp_subflow_reset(ssk); return; } =20 - MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPTX); mptcp_subflow_ctx(ssk)->send_infinite_map =3D 0; pr_fallback(msk); } @@ -3717,16 +3734,15 @@ static int mptcp_connect(struct sock *sk, struct so= ckaddr *uaddr, int addr_len) * TCP option space. */ if (rcu_access_pointer(tcp_sk(ssk)->md5sig_info)) - mptcp_subflow_early_fallback(msk, subflow); + mptcp_early_fallback(msk, subflow, MPTCP_MIB_MD5SUM_FALLBACK); #endif if (subflow->request_mptcp) { - if (mptcp_active_should_disable(sk)) { - MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_MPCAPABLEACTIVEDISABLED); - mptcp_subflow_early_fallback(msk, subflow); - } else if (mptcp_token_new_connect(ssk) < 0) { - MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_TOKENFALLBACKINIT); - mptcp_subflow_early_fallback(msk, subflow); - } + if (mptcp_active_should_disable(sk)) + mptcp_early_fallback(msk, subflow, + MPTCP_MIB_MPCAPABLEACTIVEDISABLED); + else if (mptcp_token_new_connect(ssk) < 0) + mptcp_early_fallback(msk, subflow, + MPTCP_MIB_TOKENFALLBACKINIT); } =20 WRITE_ONCE(msk->write_seq, subflow->idsn); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 34c0863f1eae..ceb2f2ba2cc7 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1220,24 +1220,6 @@ static inline bool mptcp_check_fallback(const struct= sock *sk) return __mptcp_check_fallback(msk); } =20 -static inline bool __mptcp_do_fallback(struct mptcp_sock *msk) -{ - if (__mptcp_check_fallback(msk)) { - pr_debug("TCP fallback already done (msk=3D%p)\n", msk); - return true; - } - spin_lock_bh(&msk->fallback_lock); - if (!msk->allow_infinite_fallback) { - spin_unlock_bh(&msk->fallback_lock); - return false; - } - - msk->allow_subflows =3D false; - set_bit(MPTCP_FALLBACK_DONE, &msk->flags); - spin_unlock_bh(&msk->fallback_lock); - return true; -} - static inline bool __mptcp_has_initial_subflow(const struct mptcp_sock *ms= k) { struct sock *ssk =3D READ_ONCE(msk->first); @@ -1247,14 +1229,16 @@ static inline bool __mptcp_has_initial_subflow(cons= t struct mptcp_sock *msk) TCPF_SYN_RECV | TCPF_LISTEN)); } =20 -static inline bool mptcp_do_fallback(struct sock *ssk) +bool __mptcp_do_fallback(struct mptcp_sock *msk, int fb_mib); + +static inline bool mptcp_do_fallback(struct sock *ssk, int fb_mib) { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(ssk); struct sock *sk =3D subflow->conn; struct mptcp_sock *msk; =20 msk =3D mptcp_sk(sk); - if (!__mptcp_do_fallback(msk)) + if (!__mptcp_do_fallback(msk, fb_mib)) return false; if (READ_ONCE(msk->snd_data_fin_enable) && !(ssk->sk_shutdown & SEND_SHUT= DOWN)) { gfp_t saved_allocation =3D ssk->sk_allocation; @@ -1272,12 +1256,13 @@ static inline bool mptcp_do_fallback(struct sock *s= sk) =20 #define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)\n", __func_= _, a) =20 -static inline void mptcp_subflow_early_fallback(struct mptcp_sock *msk, - struct mptcp_subflow_context *subflow) +static inline void mptcp_early_fallback(struct mptcp_sock *msk, + struct mptcp_subflow_context *subflow, + int fb_mib) { pr_fallback(msk); subflow->request_mptcp =3D 0; - __mptcp_do_fallback(msk); + __mptcp_do_fallback(msk, fb_mib); } =20 static inline bool mptcp_check_infinite_map(struct sk_buff *skb) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 11c5b042c2e1..e140d032eb3e 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -544,11 +544,10 @@ static void subflow_finish_connect(struct sock *sk, c= onst struct sk_buff *skb) mptcp_get_options(skb, &mp_opt); if (subflow->request_mptcp) { if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_SYNACK)) { - if (!mptcp_do_fallback(sk)) + if (!mptcp_do_fallback(sk, + MPTCP_MIB_MPCAPABLEACTIVEFALLBACK)) goto do_reset; =20 - MPTCP_INC_STATS(sock_net(sk), - MPTCP_MIB_MPCAPABLEACTIVEFALLBACK); pr_fallback(msk); goto fallback; } @@ -1406,7 +1405,7 @@ static bool subflow_check_data_avail(struct sock *ssk) return true; } =20 - if (!mptcp_do_fallback(ssk)) { + if (!mptcp_do_fallback(ssk, MPTCP_MIB_DSS_FALLBACK)) { /* fatal protocol error, close the socket. * subflow_error_report() will introduce the appropriate barriers */ @@ -1424,7 +1423,6 @@ static bool subflow_check_data_avail(struct sock *ssk) WRITE_ONCE(subflow->data_avail, false); return false; } - } =20 skb =3D skb_peek(&ssk->sk_receive_queue); @@ -1860,7 +1858,7 @@ static void subflow_state_change(struct sock *sk) =20 msk =3D mptcp_sk(parent); if (subflow_simultaneous_connect(sk)) { - mptcp_do_fallback(sk); + mptcp_do_fallback(sk, MPTCP_MIB_SIMULT_FALLBACK); pr_fallback(msk); subflow->conn_finished =3D 1; mptcp_propagate_state(parent, sk, subflow, NULL); --=20 2.49.0 From nobody Wed Sep 17 18:02:53 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0A0A1E832A for ; Sat, 5 Jul 2025 07:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700309; cv=none; b=HqkhrhQ4CiGM4KuP1hAtHiHdhybr/SosiEjxnm1CTZg0Ui6Cee9EWZRjSYk32C75cjyIiffusS3kLuYa/riqwkOqsPgrT3I0uzrvAOXehptsxrsvKseb8M94VhcQb9r66BOstValYzFs/JaB4tyDOqSaPNMzNVKGxG9O7SxT+po= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751700309; c=relaxed/simple; bh=0kTjdVT7h1dR+gvoMYEwcLAWTm9TbvARWAqnUMl+9Tw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=Ls3qwvd4o3ivXABgDL+rdlupLM8JbeAknQA6ZBr5UdnlpnR+pXGW81Rw4uWZ5g2pr5Z3j7mN+a78rmm2y1BaBDUyTF7f3Ok5nTPVVH7agKl002zU1Td7LRh3F+M36fDqacaUDHJgt+vwswFb9WhPn887inJxJbbUuro7nxr/iVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CSqKOGdE; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CSqKOGdE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751700306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BrOw1Efc+XtHk0VTw8vzTwX5pSE7zkELVwBgzoL1j2Q=; b=CSqKOGdEaAbe9bEifD7F0k+5btpV+y+RjaQC9GV2lOfXVbp0WUYYQDphEzwHC/0qMMaVgY YJN8PlL9S49YF3S08pnwfYU5xCDfQ1J5oezBIIP9gRB1ZVD1L3erXooAYPQ0syPd2QzoJ2 mMkeQFD0LrdFjKZjIz4yYnZMi8gR/QM= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-163-oGRVkQ8MMtyEnkMoPlsHdQ-1; Sat, 05 Jul 2025 03:25:04 -0400 X-MC-Unique: oGRVkQ8MMtyEnkMoPlsHdQ-1 X-Mimecast-MFC-AGG-ID: oGRVkQ8MMtyEnkMoPlsHdQ_1751700304 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1BF981978F61 for ; Sat, 5 Jul 2025 07:25:04 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.45.224.15]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 16F6A195608F for ; Sat, 5 Jul 2025 07:25:02 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v2 5/5] mptcp: remove pr_fallback() Date: Sat, 5 Jul 2025 09:24:49 +0200 Message-ID: <189eef71d3406ce2931e6d9442c0c5bba1df42fa.1751700000.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Yf8jop5Ez-wwKs-W95blLXdnepN9s9ML5p_DLJG9Sbw_1751700304 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" We can now track fully the fallback status of a given connection via the relevant mibs, the mentioned helper is redundant. Remove it completely. Signed-off-by: Paolo Abeni --- net/mptcp/options.c | 1 - net/mptcp/protocol.c | 1 - net/mptcp/protocol.h | 3 --- net/mptcp/subflow.c | 2 -- 4 files changed, 7 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index c9e1f3ec3772..878bb147409c 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -980,7 +980,6 @@ static bool check_fully_established(struct mptcp_sock *= msk, struct sock *ssk, subflow->mp_capable =3D 0; if (mptcp_do_fallback(ssk, MPTCP_MIB_DATA_FALLBACK)) goto reset; - pr_fallback(msk); return false; } =20 diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 5f99f02c827c..397a135cb811 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1166,7 +1166,6 @@ static void mptcp_update_infinite_map(struct mptcp_so= ck *msk, } =20 mptcp_subflow_ctx(ssk)->send_infinite_map =3D 0; - pr_fallback(msk); } =20 #define MPTCP_MAX_GSO_SIZE (GSO_LEGACY_MAX_SIZE - (MAX_TCP_HEADER + 1)) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index ceb2f2ba2cc7..d39991c90582 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1254,13 +1254,10 @@ static inline bool mptcp_do_fallback(struct sock *s= sk, int fb_mib) return true; } =20 -#define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)\n", __func_= _, a) - static inline void mptcp_early_fallback(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow, int fb_mib) { - pr_fallback(msk); subflow->request_mptcp =3D 0; __mptcp_do_fallback(msk, fb_mib); } diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index e140d032eb3e..af9f09b8736a 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -548,7 +548,6 @@ static void subflow_finish_connect(struct sock *sk, con= st struct sk_buff *skb) MPTCP_MIB_MPCAPABLEACTIVEFALLBACK)) goto do_reset; =20 - pr_fallback(msk); goto fallback; } =20 @@ -1859,7 +1858,6 @@ static void subflow_state_change(struct sock *sk) msk =3D mptcp_sk(parent); if (subflow_simultaneous_connect(sk)) { mptcp_do_fallback(sk, MPTCP_MIB_SIMULT_FALLBACK); - pr_fallback(msk); subflow->conn_finished =3D 1; mptcp_propagate_state(parent, sk, subflow, NULL); } --=20 2.49.0