Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp357630pxj; Thu, 20 May 2021 10:55:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD0PygBDob5/bE0MUSa34QrrxB4KFE2orhoA5xMbOEEZ799FLXbkRkB8Wy3p4GIuOmaHQ0 X-Received: by 2002:a17:906:dc7:: with SMTP id p7mr5931876eji.284.1621533303086; Thu, 20 May 2021 10:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621533303; cv=none; d=google.com; s=arc-20160816; b=vYjrSZneq90137akt4/m7rvW+POU2BCnxATfm/j0uGO+tpg4KUI6sJ+ozWW4gpVKx/ yes4Xld7bAZu/D/Fx+h01ntmnUl+fJ9vcJfBRD9me98gUkALtvaVreCmShN03xbBJakH RUcMl4iTYEBTlX+DLTpM4Dmqg+o2rIK8+FVe9v7luc8tIDo2ubPuaTOkK9Vjw24Yxp3q ROLsUwZatKx1BHemtS3vAynfiEcncwZg/nB+E/pTCyXQpIN0WEpjwoPMz2xediMaFPCx YMjEIpyAoslX8N2dR52oyBZrgSG6RzP9TIcC5iqZqhj1qQo+dg/HKVsJoiUS60mi1Vjl x1DQ== 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=AG7TE2gkGSuYw8HLvwXYs0/ASG1BHetPArNwvZfgVpc=; b=gySqJk4pl58eOYAKNwafhMR0jFZvQlux5NAgkt40KB/HUMXIhh+9n6b489rNd+pwPE u3pQNarUNoadrLV8BMvtGhcbg3bkIZ/y7sYP6PNtvLDP4mszk3tpFmebxEGJi24xG3Mv Qhks2nSSwjpZcsAiNWExV6H1A5XwELziKMgqJs6LhCnDHS09i159kivYQntOSJtcQSjh /FCJ9+JuTe2eBtkpf5C79uWhsSFDEi9M5kz+n4mAnZ/HAzicw6CLejnBlfRFMs/PkA9I Ab72Q8VM6WsSvDWze8RFjPMUJeao66Ts5JBn7xEcj68lBE3H8JW3Zoev6TqiCs+LTci2 9nSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tq0UB60j; 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 a24si2916619ejy.174.2021.05.20.10.54.28; Thu, 20 May 2021 10:55:03 -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=tq0UB60j; 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 S235723AbhETKMJ (ORCPT + 99 others); Thu, 20 May 2021 06:12:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:38522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235408AbhETKE7 (ORCPT ); Thu, 20 May 2021 06:04:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9172160FDB; Thu, 20 May 2021 09:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503650; bh=v7WNeIKAggA4A//ov3l2VfYNkIpomM+0S0k8zUSHcaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tq0UB60jMjixqOzAdLe8sO5R/REqmZEVo8Nqouv4KOlF52dYyjXaiPwcsoWCr4G1n /z44sIEdnlE1AqEdTlQgJgzxTJi+mEkSvm6z/atRabelxV3IY3MRyg4Q8cyq8/N3xp 2YsQPQxFKfHZ63eONlcf3OPHbGEgJsUxYkZ/7GeQ= 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 4.19 317/425] mac80211: clear the beacons CRC after channel switch Date: Thu, 20 May 2021 11:21:26 +0200 Message-Id: <20210520092141.850912526@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 c53a332f7d65..cbcb60face2c 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1185,6 +1185,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