Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp33196pxj; Thu, 20 May 2021 03:58:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxag/AO/ExiRpCyEedeWcyYg4VjKVaQxkZBPEic+fisp9tDYL1gtVvIyFyOPsURQ2Vi7eM X-Received: by 2002:a05:6402:5174:: with SMTP id d20mr4437889ede.248.1621508308037; Thu, 20 May 2021 03:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621508308; cv=none; d=google.com; s=arc-20160816; b=YsIUuCXHNc6yYrst6j3GC2f5ZXjZD21lDBbDtP+bT29wAdP+Z7ik81HJmFpWyCxOqq sp3dOwMa1OaZ2Wn9QSBHRZQrsw0Gszvrqn4Vh7zz0ZGJyboyf8MncdRmVp5Kn3f198yk YhceIiuJQ01S3Rco/GCpu7BocG9m4OIU9DG1ATRFL03aMdBiZZRtJlwV0PjIddYZVSGV Wrm6GVbHm3pss8DbBx0BZ7LC5cG1zXQb/eUTOPSfjIpyeYyhGgc+6Ddfhkz3eLIabiqM Q4+KBP3/e3cjJaPbvuEJHT4J09XU9xdBxQh17hXKDFXG6b7NZZbIj3XNtciOlNUUbqP/ CxxA== 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=p2YSBWWHb2+rBjzzcbrtDGGn7wums0ARzC2WTltoJok=; b=FiYr41nKOq6OS3XNWlBXZV1eDGApkZs1CdPBILZppthbwOBKLuX2ReI9zh4w7YdoqO vGogF5t5yqKDxTV0LGBjnMaxAvIs7F7ePysyKSFMmzYpy9ugo10CA5fmdAmvGaYR5OzE AXxtzIKK/7utQ1y5ugYtngQuQcmygaoK2MqlNQ4bUNPxPuz4BwbOq6JebsVbK821ikEu P3id1V1FTMYIzVaXYuJ1eNdPVh+drA8AZljwkWJklthqChaHcdMgoQIohJJivKqwa99Z +vVA8BXu9uf1aynt2HTNGiSpGvoUVI1St9r1Wyf3fLmdyoLp2WW/3qIt5B99YyfX1+AL qLWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h0hw2I5y; 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 fc6si2012681ejc.580.2021.05.20.03.58.01; Thu, 20 May 2021 03:58:28 -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=h0hw2I5y; 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 S239391AbhETKyx (ORCPT + 99 others); Thu, 20 May 2021 06:54:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:39816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238158AbhETKjc (ORCPT ); Thu, 20 May 2021 06:39:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD13461C75; Thu, 20 May 2021 09:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504510; bh=tdL120Z+O58AkGBQEdY5Ps5k7F7jNIs89GWh0yGiN0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h0hw2I5yrJP63swtvjfuut8rcdgeKHNJle5wn/AgdU4v6DLkHvUYr2aH+Byn9VorA 9UubEiwUyvHekK9PjcXdI2kO4EsvKfWxZzHACmeGrjOoZycc7cE9euiKda5KhfkXIr rZT3fOnJiOBdAp8o2LyYqB88MZ9ktbYmM13USmrs= 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.14 244/323] mac80211: clear the beacons CRC after channel switch Date: Thu, 20 May 2021 11:22:16 +0200 Message-Id: <20210520092128.553825935@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 ab26b8b95471..a3ec3b1bb324 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1100,6 +1100,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