Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2966626pxj; Mon, 17 May 2021 14:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnO4i+VxcClCNv6UU6LoPFxRbXRQrsOdii8+21arw6L2sC2Wbxoxrt2tcF66XM5WYMKEIG X-Received: by 2002:a02:380d:: with SMTP id b13mr1921185jaa.77.1621286461508; Mon, 17 May 2021 14:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621286461; cv=none; d=google.com; s=arc-20160816; b=wHRPUHiskX2pkpFrsrxXOGZanx2kdykq2tquZCjs9dbfVPUVr6ALs8i0zDz3l1KnRg TSAnf+01WxrGxYpYGlaSHoO4jJfleonw45fyloVPDIlNHZtR5fwlw2wV4e8+zDYdAA0O 1Ir4IlHq7AmDxVOIKLqXlZKmiSDnZoDZIJxmbK/0wdMl6yzfVaBsyuwOnoiq0lkY0FlE ywzGg5p8JXIIctn0/HsRiCWTmJA2R65GBfVq+rRkMuMUL4uqYxx0vbjlsSs7lra1zzJf 7j1Y6LuC6HvBh4zw9XZkCo3jfTWEsofU90xozqr781tLsNLDmFXdD+KvTqJFPq+W+TIG GyqQ== 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=EFueFv2BDjOelQwY8Sc96LyvkJRS4CnnPzuf8wrLnkI=; b=ymv168WyIFiFhA4d+F7LrDhJCautDK/o7wv9NUB3hXjnXD9BTPPJueef39lx2igvCz Z/PmAOkt+jRmO2FMA0nvAstvphYb6VImrWvNHBC1i0VB4YnJZZeAwsN5tOcO2IBrNA8b CmNewOHeNi49v83m/Wa5k34JXTj/jtupna/oU/ic+Gafg6Jsv3zddXVGYw4WXB11oSzy xczu6TErj298+pGeTjTDPS5c3fSiwAgS3Il5RQ2TOZf2bdEuwUJzoci4eMifBvWoOvb0 Xlan1OVfgdRhFi3V95DmTaVZ8DH+L8aHC6QNQ3Muu7A/zrTO1nHjUEITUzv1hiaj4HUY QSuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bU8KAOst; 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 w12si18822252jad.49.2021.05.17.14.20.47; Mon, 17 May 2021 14:21:01 -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=bU8KAOst; 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 S236301AbhEQOKq (ORCPT + 99 others); Mon, 17 May 2021 10:10:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:58902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238111AbhEQOIA (ORCPT ); Mon, 17 May 2021 10:08:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12B8F61209; Mon, 17 May 2021 14:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260387; bh=RYJFBR3GQ8Xd0J8jaYkkYHAiFJ08CpgfGIi/7L2F32k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bU8KAOstkD/qU4FYifL+T1CNHqQRomZhJ3M+t9NoiB4KFIt3zZtMnvmdjoidjvOp2 EyWlyXg2+3UHwQ8kGwq1i0yja3LdWx/DDf16T7SdRX8TwVFfmc6meHtDkrtzuxrYUv 4beSGoW72vS+gkWPF5IK/4DK9r3rrUUZbrXu5L8I= 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.12 057/363] mac80211: clear the beacons CRC after channel switch Date: Mon, 17 May 2021 15:58:43 +0200 Message-Id: <20210517140304.545648898@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 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