From nobody Sun Feb 8 13:13:14 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:9f92:0:0:0:0:0 with SMTP id a18csp1881718jam; Wed, 9 Feb 2022 01:47:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFnmHgkKf+XSLxEl+ZGBqwpVKrUxSXhZWhMR/9LuKzIaSGntEeRuNnR+KrkS1sa3AjFkl3 X-Received: by 2002:a63:1a21:: with SMTP id a33mr1240876pga.35.1644400070091; Wed, 09 Feb 2022 01:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644400070; cv=none; d=google.com; s=arc-20160816; b=V8Io8BD4jOogLc4cE5TQgnw1amRMdB7xgfjjgVfKQJao9ZCZ3eR5TQj/IA39fAUU28 NSA92o78lWtNdCna44VPgM9zi7iaI8mK15CPwTgmmnvMvZ1ladpxhqbtoqZ7qwHFQYHU lz+w8T+1WVybERrMEXROILvpKE4f9cRIHrbtME0qSfgPTlXQ0I9M7JzK9eZjJA6WPJl8 BWMt+sj0MxkCsGgfFWS631d5vNgDidK7zj1qIRYXveRDIYno/5KyJI6ObCQByuV1vc4z NpuocPGY4NS1amB44H0TRRO6ptD+1PvrOAjzJnWdo2NhKul2KCk91kzpDpE2fl+9kPzc zKMg== 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:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=VjyLRsATisKMfjqiT3pKbCmM2hXi2rvfQiTVWDRgKJY=; b=WRcJda9usOPl3ZBC3q7P80Zfqbo7ApTXgw+M+YUuAfzZKu4kKR9FFSd+qeTdaKcxyw YU2IP+ks4NyDiVZ+pqfYRNn2yNWmUuDqnrs8i93rY6T9vH+hSf4C15LnfggK3TNTI6hF JvJHbnan2I7cA1nIaelbQmOnwPqfAy6dnI8CmwC/vK9MgRn5HFHj/U1ZN/C2dn8rFGYQ PVyYbpFZVWQuaIpE/O1iJB15LELlvuxCsNOOcZeTaR9dUCBML6ZmnKzRNNvxKOzZma2F lA7xnsiehzwjjN4FN5cwaHDAptA6dPZZz5w+vbh0Rs5wxvIfuIJsSwW/YZZEopeRVwfh j3Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IW6bwFyR; spf=pass (google.com: domain of mptcp+bounces-3564-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-3564-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 p1si5121512pfo.274.2022.02.09.01.47.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Feb 2022 01:47:50 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3564-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=IW6bwFyR; spf=pass (google.com: domain of mptcp+bounces-3564-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-3564-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 6D2553E0FDC for ; Wed, 9 Feb 2022 09:47:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87A4D2CA1; Wed, 9 Feb 2022 09:47:46 +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.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 946F42CA2 for ; Wed, 9 Feb 2022 09:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644400064; 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=VjyLRsATisKMfjqiT3pKbCmM2hXi2rvfQiTVWDRgKJY=; b=IW6bwFyR79ZVJrV5OQSSe6EDctYmCSPRe1qh67g1e0c0qyQXtBCWl8XxoekfE5CJvkf2d9 jsSKRudlBnZ3R9jErFJEals9wtpQKap/tAOIPO/8yhKsCjSae7a3z3uH8JakyPaRh1diWn o4nmBW69FNPYIZvaTD7FX+1KxKkTkZU= 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-318-ExglTkV4O4WdB4_AX_3fnQ-1; Wed, 09 Feb 2022 04:47:39 -0500 X-MC-Unique: ExglTkV4O4WdB4_AX_3fnQ-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 8527E192AB6E for ; Wed, 9 Feb 2022 09:47:38 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.193.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8EDCE2C6 for ; Wed, 9 Feb 2022 09:47:37 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v3 1/4] mptcp: fix race in overlapping signal events Date: Wed, 9 Feb 2022 10:47:30 +0100 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 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" After commit a88c9e496937 ("mptcp: do not block subflows creation on errors"), if a signal address races with a failing subflow creation, the subflow creation failure control path can trigger the selection of the next address to be announced while the current announced is still pending. The above will cause the unintended suppression of the ADD_ADDR announce. Fix the issue skipping the to-be-suppressed announce before it will mark an endpoint as already used. The relevant announce will be triggered again when the current one will complete. Fixes: a88c9e496937 ("mptcp: do not block subflows creation on errors") Signed-off-by: Paolo Abeni --- net/mptcp/pm_netlink.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 93800f32fcb6..fb8d4bfcfbd6 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -546,6 +546,16 @@ static void mptcp_pm_create_subflow_or_signal_addr(str= uct mptcp_sock *msk) if (msk->pm.add_addr_signaled < add_addr_signal_max) { local =3D select_signal_address(pernet, msk); =20 + /* due to racing events on both ends we can reach here while + * previous add address is still running: if we invoke now + * mptcp_pm_announce_addr(), that will fail and the + * corresponding id will be marked as used. + * Instead let the PM machinery reschedule us when the + * current address announce will be completed. + */ + if (msk->pm.addr_signal & BIT(MPTCP_ADD_ADDR_SIGNAL)) + return; + if (local) { if (mptcp_pm_alloc_anno_list(msk, local)) { __clear_bit(local->addr.id, msk->pm.id_avail_bitmap); --=20 2.34.1