Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp80104rdb; Tue, 19 Dec 2023 09:53:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzHo6yGL1vtvpx48lqxNTvMrx1yBh73Vs2PeIR2CmrELfYYwsetIYSkK7CHn016X/y5eEO X-Received: by 2002:a05:6a00:189c:b0:6be:314c:16cb with SMTP id x28-20020a056a00189c00b006be314c16cbmr25086488pfh.10.1703008388637; Tue, 19 Dec 2023 09:53:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703008388; cv=none; d=google.com; s=arc-20160816; b=0f6xhR3Sc3Pt5I7zpZAaZRmjaMDLPTznR43LHb7FWDzjbPl8wdkHrH6Xt3/EYLghzX YUz+vo9DUohFtJTjHrLBzxijdQ1j8+JkUrckBALW8rzqhc6sVFqlFCBSPcrht6ynk9st X5H7YA/mBWJQzJk8IscfWk/FpBTPVbAvYzrJ3N5q8v8KuDP4m8xzu96NMBGd0nLuZshf c7vNWjB2phlqt+GpWAjScplJMww0kb5+OIssv2QCkkoC7PhSKcbAsRS105fjiMuF6D84 q2sx1ErKJzGg6RHxUX4puBJOjIReE2hdilhEnlbP5B5xWtoSCnR1SniLOHPd1EvjMcC5 91AQ== 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:cc:to :from:dkim-signature; bh=c2glkK08gaI9GPNR0+UhswACTKny56daxqsu6gytBB4=; fh=72F3WCVCvzV08J/CpxB/IwCzw6VwyjlUZur/aPBNqHA=; b=nI3NimY2TwrWPWABUC8HL/WqO8FZCLMd061mUIpTFeRQSJUMdO5wrENMKT3XC4E4Si AV/WX/TOBRFIPTfBgukfyjmLBmpbdnSMAMzPZd0pO1HUPu980ewBV/yzBA6AR5GfwuHZ hV6n67/ZtOW23cTdEHo+b4Uucy0CfGCDq0cGgWVu11DHK8VzgN9Cf5TwMkLb115ZiqYV ESVwFgYfte5uWYBp9a/d6Y4RUUeCi0/9/SkPWWTrylKsBykE9n8d0OsghMZCtMPmgBDH qMeDG27052q8+FxLXzFnpzBTq0jCl70UhV1WiXfRxamK90hiZptHekmPoSGh2LhH1AfQ 2F2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@w1.fi header.s=default header.b=QdxzYqNN; spf=pass (google.com: domain of linux-wireless+bounces-1015-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=w1.fi Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b186-20020a62cfc3000000b006d3a2af2025si5961737pfg.77.2023.12.19.09.53.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:53:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1015-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@w1.fi header.s=default header.b=QdxzYqNN; spf=pass (google.com: domain of linux-wireless+bounces-1015-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=w1.fi 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2BF85287E1E for ; Tue, 19 Dec 2023 17:53:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10F62374FC; Tue, 19 Dec 2023 17:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=w1.fi header.i=@w1.fi header.b="QdxzYqNN" X-Original-To: linux-wireless@vger.kernel.org Received: from mail.w1.fi (mail.w1.fi [212.71.239.96]) (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 990DC37D12 for ; Tue, 19 Dec 2023 17:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=w1.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=w1.fi Received: from localhost (localhost [127.0.0.1]) by mail.w1.fi (Postfix) with ESMTP id 37761116DE; Tue, 19 Dec 2023 17:49:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at w1.fi Received: from mail.w1.fi ([127.0.0.1]) by localhost (mail.w1.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OmrPUL6OMIMT; Tue, 19 Dec 2023 17:48:45 +0000 (UTC) Received: by jm (sSMTP sendmail emulation); Tue, 19 Dec 2023 19:48:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=w1.fi; s=default; t=1703008125; bh=I9U4uRYAD8D9AwfeRF52HtAcu0i+PlUaKEl43B3G84I=; h=From:To:Cc:Subject:Date:From; b=QdxzYqNNyF/C3j10Kwpe3EOMRXF56Ch4RrZDrcBbn5+pmEvrmPd4TngSrv0iBVq5F K7nRfyu402f7bu0dpCvadbe0jSdyhePzbP7GWmpKBEMQLeTyqGvHf9uc9hkC7LO8WU nD5YEiQb2RWxwKWlE3HXaelyRNbpntZ8TXj5Ufiyg4ljf1jK5JGAbcBEhiLg229Oor fknT0PaAoTHNU4cOee4QVsu+m8v/B8sJ4SUNVTow351a7ZXRtmPcQBjr6WaP/2Wr8T fYbjcL8oXD1AqoviJEJMTvqNuWgv+Jl9yaB5pZhN/bKzHdfG/QYOSsZ4gT6rc7fhlG FxTYb3ujoPBCg== From: Jouni Malinen To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Jouni Malinen Subject: [PATCH] wifi: mac80211: Skip association timeout update after comeback rejection Date: Tue, 19 Dec 2023 19:48:14 +0200 Message-Id: <20231219174814.2581575-1-j@w1.fi> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jouni Malinen It is possible for the TX status report for the (Re)Association Request frame to be delayed long enough for the AP's (Re)Association Response frame to be received and processed before it. If that were to happen for a case where the AP rejects the association with indication to come back later, the association timeout and retry state should not be modified anymore with the TX status information that would be processed after this. Updating the association timeout in such a reverse order of events could result in shortening the timeouts for the association comeback mechanism and that could result in the association failing. Track whether we have already processed association rejection with comeback time and if so, skip the timeout and retry update on any following TX status report. Signed-off-by: Jouni Malinen --- net/mac80211/ieee80211_i.h | 1 + net/mac80211/mlme.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index cd483787f795..32b7d3f6b4b4 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -439,6 +439,7 @@ struct ieee80211_mgd_assoc_data { bool need_beacon; bool synced; bool timeout_started; + bool comeback; /* whether the AP has requested association comeback */ bool s1g; unsigned int assoc_link_id; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a693ca2cf8cd..0c7ce022d2ed 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5381,6 +5381,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, assoc_data->ap_addr, tu, ms); assoc_data->timeout = jiffies + msecs_to_jiffies(ms); assoc_data->timeout_started = true; + assoc_data->comeback = true; if (ms > IEEE80211_ASSOC_TIMEOUT) run_again(sdata, assoc_data->timeout); goto notify_driver; @@ -6718,8 +6719,18 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) } ifmgd->auth_data->timeout_started = true; } else if (ifmgd->assoc_data && + !ifmgd->assoc_data->comeback && (ieee80211_is_assoc_req(fc) || ieee80211_is_reassoc_req(fc))) { + /* + * Update association timeout based on the TX status + * for the (Re)Association Request frame. Skip this if + * we have already processed a (Re)Association Response + * frame that indicated need for association comeback + * at a specific time in the future. This could happen + * if the TX status information is delayed enough for + * the response to be received and processed first. + */ if (status_acked) { ifmgd->assoc_data->timeout = jiffies + IEEE80211_ASSOC_TIMEOUT_SHORT; -- 2.34.1