Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp301093pxj; Tue, 18 May 2021 03:49:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGVh06T+s3oh8jzySl3L+j9+fqL89M5NIxYRZDxlOnrpY31lAcjGwsbGrlMm4JXGj5FylG X-Received: by 2002:a17:906:4ece:: with SMTP id i14mr5222533ejv.249.1621334981881; Tue, 18 May 2021 03:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621334981; cv=none; d=google.com; s=arc-20160816; b=t1nwnpYuqTyebsIR8NngstRlkhUzYgeqL5FitkP5iKeOrrXoo1dyn1w5J1S9v+oEpy HSvp5U8dGFEuCb0ITPnUWEV0jF7AT/RFYawOKSGBwuwcfx3Ce9jQLJiQeIykhY/Dnmu+ asXO+klXR2dSUzbbYchxa5wTdVDW9l7hSz2dhij76qygkIhvMkzPsNkc31EJGTdtvNF8 JOErRq3T9Fktk4I1O2bb7ad4nLfu0KS2XOqZGYRd1YMaSO1gEK2/GjXTC6Kp6jvONnxX dL1s9FCHcwgeJqUtMiO6D+WsbpnHPyUX+SECAcnuAogwv/WD3xBVjk5s/38d2aPTE8tG nncA== 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=XK1iwC6iNkWlFXuo18VToCp9dAuQXM0PlO1BBRSxJ7o=; b=X6J+s2288lLUGU/sHF4bRK3n0ot6o0/jExFBe7SYGfdIuQ3Gvn/F8ZYf5ZUiya2Ntt XvevZWo8fi7XbHsECCtxtmsopTXMwIi0kEM9AMfeDqvzKGE0pTT7jTqYnsKmL0jqM4dc LYAh3phLxhkiORpm+JD8u+ghd1Vcg4nhouGAghFBWvk271tFPZA/q0C6UNZNyzuk0xqV InuEFC65i+Bafnk+T/nuE/4dHcu+emyZGrADwn8ZJnrZ0fCzb/uV1Xtp/TWhv2NZHMiE u5wBsFHQbs89chLb8wMP+xJXlfEEn4htlhXW16azXjDIeqhcNcVK61wsYYglSgmmHT1S rY2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cnXuzG2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu19si18194325ejb.538.2021.05.18.03.49.15; Tue, 18 May 2021 03:49:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cnXuzG2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241936AbhEQPP1 (ORCPT + 99 others); Mon, 17 May 2021 11:15:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:45090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240052AbhEQPFU (ORCPT ); Mon, 17 May 2021 11:05:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CEBB461582; Mon, 17 May 2021 14:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261726; bh=xwuLWojHP5Hg4h0xP7sbXO+rq65Smp/CTzPEGhCWUcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnXuzG2QhtaBYqg7O08Z93Pq7uUDSMtxz9XRPiNw1OOqYx+WrE5fP5+PKYS2HSkn7 n+5nGS0db6+yxv7A52lqypiuitE5hgG6igUdYYxN7sUxnpBXVL6c4v/r6YZFndAsvG PWolQgE3Qz98wFmpmO3CiaFknYwdPRGvS9ilhIO0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emmanuel Grumbach , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 045/289] mac80211: clear the beacons CRC after channel switch Date: Mon, 17 May 2021 15:59:30 +0200 Message-Id: <20210517140306.713286365@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Emmanuel Grumbach [ Upstream commit d6843d1ee283137723b4a8c76244607ce6db1951 ] 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 Link: https://lore.kernel.org/r/20210408143124.b9e68aa98304.I465afb55ca2c7d59f7bf610c6046a1fd732b4c28@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mlme.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index ef19c3399b89..6d3220c66931 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