From nobody Thu May 2 06:08:05 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:9f92:0:0:0:0:0 with SMTP id a18csp2234085jam; Wed, 9 Feb 2022 09:15:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJySg4zy0mclCiOt5jpjjney8oir+0MSBQ7hBCG9lRgsPElSBUkVrU/3MHjQ4bvS/yPeCAPF X-Received: by 2002:a17:903:31cd:: with SMTP id v13mr3104866ple.29.1644426952950; Wed, 09 Feb 2022 09:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644426952; cv=none; d=google.com; s=arc-20160816; b=ev9pfJlgdBN8QuHGanCscijAzmJltNEFwrkhC7Gd2Iz+bZUiOF57g2mlZZM3B5/ghU fBNmyZ1nXZC38+lh1N3aAtmbD2e1p7bXR9kCN3MZgQ4Bv+QctKLvGMq1rSLyuPuZ8dk4 xug31QAfuoZ4mERLf8uSWCBuQub1+YUmU7I7Q+SlTLXspovFxd2EsG1XTbhjiZpFoEof MBMtW7A0d9ULe4LuD1fdYi8EUzy1ms9+v8OEBhVPQ6Xrmiy7bZ0I1I6nFvuwa8bMx0HC tstEMb3xlvekTGtoKhydRL3FajhfZY83GEMJ4pvES6fkSKCkDnWk7b2s/Ua2P7lA9bWR 3Gwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=BztjXPpTzaaFluHSreLlewojZzpXcIprVaNBTThvabo=; b=vZZMeHBQQBHGmv24qGOyehuPdmPe+OGCNsb7L9XkTehK6IRE5TSkcZPpBSbgthBuEJ GERq1EuOKw6XhjrJaMYycMbgJyGNOn/K0lnZ2Hiop9UHbHse+9XKEvOjGz7Kds01uJlz 2W11eF05dO2MFrDrR6vdqmxfgEL7yhuoY1+1bBGJG003em7wsObsVnEejVYaHRyeI4gi BR8DHAgisYnHjPJe82lv0tbzvEE2JT8KaHt0SzZoOvLcOwbZsVcI4Em+ZUbcEcTRfCJD 45/DOjKV2h/TmAqfPvqHQQ8sPU4JoIYufFvAihUO5vcTGHWJEf72d1ZWKT3TShKQYB0H WdsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eswQHktV; spf=pass (google.com: domain of mptcp+bounces-3589-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-3589-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [147.75.69.165]) by mx.google.com with ESMTPS id w1si4632941plw.439.2022.02.09.09.15.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Feb 2022 09:15:52 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3589-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) client-ip=147.75.69.165; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eswQHktV; spf=pass (google.com: domain of mptcp+bounces-3589-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-3589-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id EAC473E0F83 for ; Wed, 9 Feb 2022 17:15:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E820529CA; Wed, 9 Feb 2022 17:15:50 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev 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 7A6CC2F23 for ; Wed, 9 Feb 2022 17:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644426948; 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; bh=BztjXPpTzaaFluHSreLlewojZzpXcIprVaNBTThvabo=; b=eswQHktVyXZj0ZDfm3+D6Ca+kD05vuxtfcGGqvWbh3XPcjNdfR7U/FtAatnWBDpp9bNAsn Vxx1Tsa2yz+ka6qWR0eZqMyLBP+9g6PJ/MNXvbOFpl5CyiXd2dYnmRt1feS7pAlJaw7/4K t2QvbR1AYnRlct7YDGdz0Z2YChqGtHI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-UTwvKKWhO8KkCs2gebsShA-1; Wed, 09 Feb 2022 12:15:44 -0500 X-MC-Unique: UTwvKKWhO8KkCs2gebsShA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6AF378144E1 for ; Wed, 9 Feb 2022 17:15:43 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.193.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0C9A2C1BF for ; Wed, 9 Feb 2022 17:15:42 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net] selftests: mptcp: be more conservative with cookie MPJ limits Date: Wed, 9 Feb 2022 18:15:29 +0100 Message-Id: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pabeni@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Mat Martineau --- this fixes for me some rare failure I observe in debug build: 072 subflows limited by server w cookies syn[ ok ] - synack[fail] got 2 JOI= N[s] synack expected 1 --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 66ac990415e6..9bcb3653f78b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -822,6 +822,7 @@ chk_join_nr() local ack_nr=3D$4 local count local dump_stats + local with_cookie =20 printf "%03u %-36s %s" "$TEST_COUNT" "$msg" "syn" count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinSynRx | awk '{= print $2}'` @@ -835,12 +836,20 @@ chk_join_nr() fi =20 echo -n " - synack" + with_cookie=3D`ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies` count=3D`ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinSynAckRx | awk= '{print $2}'` [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$syn_ack_nr" ]; then - echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr" - ret=3D1 - dump_stats=3D1 + # simult connections exeeding 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" =3D 2 -a "$count" -gt "$syn_ack_nr" -a "$count" -le = "$syn_nr" ]; then + echo -n "[ ok ]" + else + echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr" + ret=3D1 + dump_stats=3D1 + fi else echo -n "[ ok ]" fi --=20 2.34.1