Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp394758pxf; Thu, 8 Apr 2021 05:31:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlhTUWubLMzvcjSUjwqxSQaqfF0uaW7V6TYSnP9L6mUG4X0gL5OOXfiVp7UqV9gs+tE45K X-Received: by 2002:a63:c66:: with SMTP id 38mr7889652pgm.69.1617885117873; Thu, 08 Apr 2021 05:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617885117; cv=none; d=google.com; s=arc-20160816; b=K59MMibkY8++suXRuM+QiawbIpthSpLWV8B+BBHUx+n/jm8V+F6AuHNBT6AZ3bwPSr JI9FKn1sI0qRIbrVZ/EA6wWgR5Bnq9UUHAg5deMwOMafhQyY53wWDQMEX8s6zjDw0RNX W39mgFjsIu3MY7wpRV2VUXbwFApu4H8uYSafCCyFJi83uvQnEeMNd/hgmMLyySVtlya/ OUx/+O38Amh/fcAQgIn/YVhqEho/GOnPYC+So3qjlXdUjGLVXiORdUF52Bcs9SEF4OCF 4g/h6DNVWAfpTuqrdXqt6oVEHeHz6k5plbehI9C4+EakYy3xvcLYwWCUr4NDbB7+fGqh WUHg== 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 :message-id:date:subject:cc:to:from; bh=swVa/JFhi9qYyDqg+o6RHFxpclLv5IFDeHicdc6HSsY=; b=kr/TNEyEyaXJlsUpbfUMwktlxR5KOtYjIN1v2QQhOV8g4SIXppgdgGFQN76L4DIHx6 EVHzPg4YT30EadyPSkUHANzWS5YMp1z6s6liqB36N0P7khxHx9SNFRPSU5uvSqaK5gll Dz9plHl0KX5StTHpiNQpqJsVdcO1u4t+0YqErmsIY3awhb2Q7b10VRQeelPf8ylSlTT8 zQuZtKSURgMcmS/d8HXYD+7DhjIGzcTFz3qeZKeDMyZ+FiyWQ0Z9SAA/LSrOd8Su0bOw Ih04FxH8tgAbfDnEi2Ey2LzfMJDNz8VMqZObm6KLQrEsW1PTBBx2Bm9FxHH+fLKFh9d7 nW0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 66si8232195pfy.284.2021.04.08.05.31.44; Thu, 08 Apr 2021 05:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbhDHMbp (ORCPT + 99 others); Thu, 8 Apr 2021 08:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231446AbhDHMbk (ORCPT ); Thu, 8 Apr 2021 08:31:40 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FCF6C061761 for ; Thu, 8 Apr 2021 05:31:29 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lUTol-008zwj-Lo; Thu, 08 Apr 2021 14:31:27 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Emmanuel Grumbach Subject: [PATCH] mac80211: clear the beacon's CRC after channel switch Date: Thu, 8 Apr 2021 14:31:25 +0200 Message-Id: <20210408143124.b9e68aa98304.I465afb55ca2c7d59f7bf610c6046a1fd732b4c28@changeid> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Emmanuel Grumbach After channel switch, we should consider any beacon with a CSA IE as a new switch. If the CSA IE is a leftover from before the switch that the AP forgot to remove, we'll get a CSA-to-Self. This caused issues in iwlwifi where the firmware saw a beacon with a CSA-to-Self with mode = 1 on the new channel after a switch. The firmware considered this a new switch and closed its queues. Since the beacon didn't change between before and after the switch, we wouldn't handle it (the CRC is the same) and we wouldn't let the firmware open its queues again or disconnect if the CSA IE stays for too long. Clear the CRC valid state after we switch to make sure that we handle the beacon and handle the CSA IE as required. Signed-off-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 96f487fc0071..4a8f1b8ce768 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1295,6 +1295,11 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_sub_if_data *sdata) sdata->vif.csa_active = false; ifmgd->csa_waiting_bcn = false; + /* + * If the CSA IE is still present on the beacon after the switch, + * we need to consider it as a new CSA (possibly to self). + */ + ifmgd->beacon_crc_valid = false; ret = drv_post_channel_switch(sdata); if (ret) { -- 2.30.2