Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3117931pxm; Mon, 28 Feb 2022 12:23:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfShhvR+DaKw457G0ppJGAkkbv1FT+8gIRp61nSYdOijLjKZ6pBGULOhmclx+m4y4KV3Ji X-Received: by 2002:a63:5945:0:b0:375:799a:281d with SMTP id j5-20020a635945000000b00375799a281dmr18901805pgm.605.1646079833001; Mon, 28 Feb 2022 12:23:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079832; cv=none; d=google.com; s=arc-20160816; b=WaDwcFJMQxGtteWOr/9ZpJRPf3cKBZijRWnsVP0GJOsTJgIQ7gcRrNVkddQ66WpuXP xE4Q1WwEJ/J2R8q+izl6/o37pEyNYHlg1E52ot8YzVeo/kZE5UNEuZZePwoArmU2WiV2 SewCW8znehf0OB/bnmCW2D+0wGeQ7nSdmw2w2oXDEm5RHlELnI+d/XzHb2anepSQ80jR uwgU5RXMDLeGe3e2UV2rmvb5qenDzPIu1tn7I7B7bGUjuF0EHTS0SzEMNWQsyoZr87Pp eZoh6SE7rX/ZyM1XJeC2bGqWlZc4ZMdA1AbJkUWG8kYhapbc3oquLKhg3V9EoQtmCNMb 1sYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vClk6T6Zz+XmbHl3//YVFi/YBSaMi8mx65CgXdtVa+s=; b=nx96sv7EZs/8Ps+M9BMSdL3EPNPJBBzIigye3AuJrsV/6Qv0IcnrioV5JVcNKioyJ9 BP0Hmsn2hn/k0n/RyvaEW59WNU7oDX2WjXIYYVxhwKlCot7YUS7aKCfLvgAJX3Yb/kc6 L1P4HP4PCDGY3nZ9LR0Lqnv5qzNVHVeRtJLxarEbT6HRwBcvMyFyMYW8VP4wmkRa/d8p i48zhKoUhrLPfLOKIYoaDAZlTcU2yxapsQX90A1Cop/5JhSm5muIvd5/aWQiVC/WI8Zi PjZwlTqnFcQ65DZ4LJ63azxOl85/+CGfXs5L1XOtUNhtnmOV1RdhKKZlrSCWCtgDukKM t4dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=slrqwLYU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i35-20020a631323000000b0037893654602si4381777pgl.470.2022.02.28.12.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:23:52 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=slrqwLYU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD4891D5291; Mon, 28 Feb 2022 11:42:46 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239712AbiB1SCV (ORCPT + 99 others); Mon, 28 Feb 2022 13:02:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238846AbiB1Ryq (ORCPT ); Mon, 28 Feb 2022 12:54:46 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F762BE3; Mon, 28 Feb 2022 09:44:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 587B9B815AB; Mon, 28 Feb 2022 17:44:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1954C340E7; Mon, 28 Feb 2022 17:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070254; bh=re8j0cwAUKK6PJWb56yhqhBnF9YWtkD/UuOaJsCwDGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slrqwLYUAMWcNjj05Fp0y5XJ56R9ckXJpNQ/L1xhsyo+T5QqZ6KZ21SPWkDGyXoBR ZUGxxzTYumBf7YfqDCqBHPQxVqfqz620UMzxBK3uFemwTUJVP0YPGX4Rj2v0Jbkb1v qgd8fRp7tV9af4hbBY2eEVqFAXLfExb9bq4A92IQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Mat Martineau , "David S. Miller" Subject: [PATCH 5.16 041/164] selftests: mptcp: be more conservative with cookie MPJ limits Date: Mon, 28 Feb 2022 18:23:23 +0100 Message-Id: <20220228172404.008132583@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 From: Paolo Abeni commit e35f885b357d47e04380a2056d1b2cc3e6f4f24b upstream. Since commit 2843ff6f36db ("mptcp: remote addresses fullmesh"), an MPTCP client can attempt creating multiple MPJ subflow simultaneusly. In such scenario the server, when syncookies are enabled, could end-up accepting incoming MPJ syn even above the configured subflow limit, as the such limit can be enforced in a reliable way only after the subflow creation. In case of syncookie, only after the 3rd ack reception. As a consequence the related self-tests case sporadically fails, as it verify that the server always accept the expected number of MPJ syn. Address the issues relaxing the MPJ syn number constrain. Note that the check on the accepted number of MPJ 3rd ack still remains intact. Fixes: 2843ff6f36db ("mptcp: remote addresses fullmesh") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -624,6 +624,7 @@ chk_join_nr() local ack_nr=$4 local count local dump_stats + local with_cookie printf "%02u %-36s %s" "$TEST_COUNT" "$msg" "syn" count=`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinSynRx | awk '{print $2}'` @@ -637,12 +638,20 @@ chk_join_nr() fi echo -n " - synack" + with_cookie=`ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies` count=`ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinSynAckRx | awk '{print $2}'` [ -z "$count" ] && count=0 if [ "$count" != "$syn_ack_nr" ]; then - echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr" - ret=1 - dump_stats=1 + # simult connections exceeding the limit with cookie enabled could go up to + # synack validation as the conn limit can be enforced reliably only after + # the subflow creation + if [ "$with_cookie" = 2 ] && [ "$count" -gt "$syn_ack_nr" ] && [ "$count" -le "$syn_nr" ]; then + echo -n "[ ok ]" + else + echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr" + ret=1 + dump_stats=1 + fi else echo -n "[ ok ]" fi