From patchwork Thu Aug 3 16:27:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 130775 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1310592vqx; Thu, 3 Aug 2023 10:51:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHsUzK2SFNOwIt1t36sCa3LjUpXIX/YUI6ZBIrPvV1Tuc2EoXVoGodEf5FpMBl876Ly0dB7 X-Received: by 2002:a17:902:ecd2:b0:1b8:2a4d:3eb9 with SMTP id a18-20020a170902ecd200b001b82a4d3eb9mr21759518plh.34.1691085063449; Thu, 03 Aug 2023 10:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691085063; cv=none; d=google.com; s=arc-20160816; b=dVUK/fL5hZmxZYZImlSsfE00ELkVnnIkSPLTxr47PrhLNh4xlNvmvTyK44L1BS/gRz RoFoW4GQAO06WvDfiCF0qSTZjOQ0v5w/Mmgf3VwV3AniqsWk0wexprBRlvXyHQ+Bz+Tu 7fIoGgGR85/qhVtjyFi2KWqoV5d+C0xyqpBtqu6zR6GcMfIpy4KPPErP6UXptgGiNJFr xqyIcTYd/LbawHB9rApEjrBZxHF9RL8DdQvbRfqrJQXYZ20X9wzrM4l79OGCdJd8U+Ls sfGTe2RI3qmHp01dKR+QPNk+EPjsCK011HTee7LJWKGxPz6DfrKv7ONwQHoGjNmxBzgN cJNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=8jMt6L2FmSlltwvcyjEZqwtyL1aI3zkjJCogSbPktKs=; fh=JaI3ApOJlLXP0xGct+alhipsTnllmCl2zQLE6Xt9vbE=; b=W2VHnG+m4q6K/0/BG0Vxhe9TOjh2T8YF//WL/A5n5eR3qS75UoQeSOgFF+hyCw13mv tUoeDfoMx3vY1SCFBJ5zrVwg+mc7ON9sZZ9UznRupiSZwS0K5NeSaNX85j4AIVC9JYT8 /UC03NpH6GB/iYnpJO7hDLaPcKGLC6abWPRV0ZpHeMmKPIq/qwNqGppKJCalOoDNot57 mLPO/Iy5o1xcFb/savqvFgKeEHv8GEQOkC0pxSt7mAzXxVtDJ8kV6sZMiaFJZUzPwogF bc2+LT8rFDEj28HZObxzC8HB1enDkVYvzSs/2A9l2+N82nbauRb81X+4tZO5qtr4A+Os UcKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="x0w/rjxJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a170902d58b00b001b8a89a2726si269864plh.80.2023.08.03.10.50.49; Thu, 03 Aug 2023 10:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="x0w/rjxJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236617AbjHCQ2K (ORCPT + 99 others); Thu, 3 Aug 2023 12:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236576AbjHCQ14 (ORCPT ); Thu, 3 Aug 2023 12:27:56 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 159B33ABB for ; Thu, 3 Aug 2023 09:27:53 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbc59de0e2so11517995e9.3 for ; Thu, 03 Aug 2023 09:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1691080071; x=1691684871; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8jMt6L2FmSlltwvcyjEZqwtyL1aI3zkjJCogSbPktKs=; b=x0w/rjxJnVBmVbgGNo/kxrqp7ZOR0vgZhvYU2UJJOzYBlcQGR58n2VVhLQb1K0yB49 pm/cch1ViXDza5o26swt637wlroTwytiU4vZsvrtD4N4QrskCpCJcKJYzNNh/EMCdcur QbmzHTXGBWJQbik0AOw8wlQG6i33+Yl6Ks8r3xIYvkztFZ9j8RwzQWbJhmMpzxyXXq5N 8WjQ2UazZUdY6yeCTHtT2qTqkJtGRG1NWHHSK1DM4VCTJCsDH/NW1D7GJE4iprznbHje KxnDw56bOj+CgdrUF/EyxzZ38++JMGqfND2F9pVsww5zRFWwpZItSbmA8+5CZDGtacPv yebQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691080071; x=1691684871; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8jMt6L2FmSlltwvcyjEZqwtyL1aI3zkjJCogSbPktKs=; b=JXYBKrqJtgTu4HxDsJQBKktQaKZCNsinhSbNXn/CEmmXnTu8d/9183x6Tk0dBLTL/8 yGRBgzLE6da5ofDHJBZdJkgyxxPd7gDgxW7/fFRrffFqtRLUfcTLHTeG6EUmsFF1PPyU bWckK/r2bskfXf8zyJ5fRw9nM4WqrgncqfAEDCrTZouNa/ptmxlftIoWQrysXGJgKNUC V3vnIwHkL+AtdfUBr3XWAHAwhNX5mqs1t6VRUmljsEtJEsr2pobF9GbHVJ979hHtpE1o Sudg70rwMWAOCFAJjICYthCMNN+MzuJ7xIgaJIoGBSgdzXfrO3dxzQagjLZpy2XHd/Lp HZSA== X-Gm-Message-State: ABy/qLYMG0++CYAnFuQGIpS2BaY0e4p5DCFlpyckha9w7YbJP4v/rqC5 pFSZ8CKGhbFmHNn01ziaYbu2OQ== X-Received: by 2002:adf:f043:0:b0:316:f5b1:98c with SMTP id t3-20020adff043000000b00316f5b1098cmr8589836wro.24.1691080071150; Thu, 03 Aug 2023 09:27:51 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id o10-20020a5d474a000000b003141a3c4353sm253167wrs.30.2023.08.03.09.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 09:27:50 -0700 (PDT) From: Matthieu Baerts Date: Thu, 03 Aug 2023 18:27:29 +0200 Subject: [PATCH net 3/4] mptcp: avoid bogus reset on fallback close MIME-Version: 1.0 Message-Id: <20230803-upstream-net-20230803-misc-fixes-6-5-v1-3-6671b1ab11cc@tessares.net> References: <20230803-upstream-net-20230803-misc-fixes-6-5-v1-0-6671b1ab11cc@tessares.net> In-Reply-To: <20230803-upstream-net-20230803-misc-fixes-6-5-v1-0-6671b1ab11cc@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Geliang Tang Cc: Andrea Claudi , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1288; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=12biSrwGtkvk41jCEN65DKfb20xXbhM8fYcweZf3BtY=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBky9WC2uO13GQR6Uk7tHPxbxR21T6sS+xXFI1Ro sRXVF4BsYuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZMvVggAKCRD2t4JPQmmg c4ReEADACIInPdd6u/8/kcSsZZjsF9iI9yoY4f3fm2Tqi0Mh8my2rGacspC4c9R82DuvfjYh0ut /eEoqGDMDcaF8Eqcza+IndPBviG6zze6q4Krt8FNtbHI9hcuXBbmbxb4v9Y215My8XR+EptGxb8 8/mSixbPVGYKiDLgyXkeztjhdU7vGshwMD5BxundrqsbIkmn2sRqlxm2uKILaT2bmfQZb2FJgLB s/ZK7hLFgGt9Wmm6Pqnb3D/UAMjWERlcEoifd84BJGjYNCNYvth9yHoUbMhknrrlLSPPUspZl+y /r8jfYLIALWVrxSm0zStmBRHASnnonref+rmeDjPwSrQK0EcYVbRaXD+dhkLLoi+EC+YwzhjuBo l01qmS90KBB+qdVlSsUHai6Qs6O0/puZulr7hXAlj531qM3iteSONNVpiGZWlv5PwQOjj9F2/+8 EUJleiTZ4MOAjYPBszY+eu7u9Duidnx9NMLQmnw1b5dYyx0g/zeQeD0np405cv7OeTuNzNNTVbU ClCZ4UNjgmyhj+GkRZqUDf5o8c2PkRrVs2bVZm1unsWt1yzRTJkBIc2txHfetivunfzKm7m08Rv kqZ50sPA7PjH8o6NUxQ18bowaHZVnLHUmlQNmDa4VGdCN9HAawzhBvgfomCVbH0NwWcYRdC1cAi 9y4SsYEABb1WMUA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773231211383929260 X-GMAIL-MSGID: 1773231211383929260 From: Paolo Abeni Since the blamed commit, the MPTCP protocol unconditionally sends TCP resets on all the subflows on disconnect(). That fits full-blown MPTCP sockets - to implement the fastclose mechanism - but causes unexpected corruption of the data stream, caught as sporadic self-tests failures. Fixes: d21f83485518 ("mptcp: use fastclose on more edge scenarios") Cc: stable@vger.kernel.org Tested-by: Matthieu Baerts Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/419 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts --- net/mptcp/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 3317d1cca156..ac7c11a5cbe5 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2335,7 +2335,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, lock_sock_nested(ssk, SINGLE_DEPTH_NESTING); - if (flags & MPTCP_CF_FASTCLOSE) { + if ((flags & MPTCP_CF_FASTCLOSE) && !__mptcp_check_fallback(msk)) { /* be sure to force the tcp_disconnect() path, * to generate the egress reset */