Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp649003pxy; Wed, 5 May 2021 10:18:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj1kxL9TH/gsDneQ/3WW3KvE6TkYMAqH5UqvtTsk3wzbkcYGys9YN9WZ2IS1z/34Met8E4 X-Received: by 2002:a17:902:b406:b029:ec:fbf2:4114 with SMTP id x6-20020a170902b406b02900ecfbf24114mr121081plr.32.1620235082344; Wed, 05 May 2021 10:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620235082; cv=none; d=google.com; s=arc-20160816; b=a0yJBB2QLopt3AVHVkg0mC6tEwpkm0c1zE8jjrN5pHUyGMHcuGLt3z40pofeutl9KY 1h+WKRvWXbBdyaKFOrfll/BqP+plBtDVtWSraMEjUne6K0sKushBNJjs/IWQFMgsyavy 8xuD/PL1y7Mblv2NBP3LOXIaZbJAeNOPQV+mAmLl38CXI+2Vtb640Tqnp3s+sjU6ck2a 5/mpXq1UgBIsVOYRUnlhwJ9QFZY6JSZ68IAqtvJCPGM8t44t4o2YAuKcEmDcyUh+B4y+ k02gnnjTtq2zOYwEowm9L5sfQkQbZeD5n6m+WhP5d3LPJFzPkIPkWdXD0FmbURWXdBEA QxLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p2YSBWWHb2+rBjzzcbrtDGGn7wums0ARzC2WTltoJok=; b=RA0NSIyUX7G1mDi3V2Ax74qQoK871e8+nwXQ0htmhGhauKhholvpBK2ZLT8KXMb18k dTjJhZDtl5v4HQD8KoMP3+nKNS0JSqmJcJVVU3d57fJUsAcYoVx75beZZD0cV3xhd7QE g1fdhjiOPXzaidY8Sn8m13/6gFho9uns+yoQTIiu7G5IS4pdbnJ3s0hxoW10R85XJe3y bhx2PPuqEFZFifVdQ+61onhkb23N3Jwh0bPId2Xeo7ArZq+gh08U16w/T+5qlr47ASXH 2nKCFBJSa83Wp/LKYiHogKb1YB7TUcUHH8CcnZVXpnn0KBo5TwyVFFh/WQSJ7wvoYZMi a4+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HItFKPTZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si4293507pgt.90.2021.05.05.10.17.45; Wed, 05 May 2021 10:18:02 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HItFKPTZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236664AbhEERMu (ORCPT + 99 others); Wed, 5 May 2021 13:12:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:33788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233997AbhEERBq (ORCPT ); Wed, 5 May 2021 13:01:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7ED3161A0F; Wed, 5 May 2021 16:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620232870; bh=tdL120Z+O58AkGBQEdY5Ps5k7F7jNIs89GWh0yGiN0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HItFKPTZlMFC5ay6UC9MqgvjVUPXf/Ow5Dq9H1SNfeEL7r8FLTz0cHHM+tck+/PIg AUCHvO5L7wIH8q39llnhEmd5rKFSCnC36RBjjYWlQKxXpNRjLgnxAK3J9cGAzWR8FI vLxaljSQbIfqZFJRctGDgYNxx9fOjZdNJhTqcybQ7ltim3v9fF/77FU9dEy5JJGZb1 F/nm4UA2cQjHXrYUA98dAUsF2SF5GFmMc+kJO9WaIDaskW7FmcwOMzh/OBMomHAuL4 ChA09PSR626/iQlRW6h5wRhLDDy+59yPSNnrLynXhqf60xIHruri6yvClrcZMXQD8/ b7kwI7Jlcbssw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Emmanuel Grumbach , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 12/25] mac80211: clear the beacon's CRC after channel switch Date: Wed, 5 May 2021 12:40:38 -0400 Message-Id: <20210505164051.3464020-12-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505164051.3464020-1-sashal@kernel.org> References: <20210505164051.3464020-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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