Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp645410pxy; Wed, 5 May 2021 10:13:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8ynhNwnUinaaeVP2vY39XybsOAojVF8zcFSpNOy0NH5dWq5RfWMCg3HYKJS3inubzMBHC X-Received: by 2002:a17:902:7882:b029:ee:afd8:7586 with SMTP id q2-20020a1709027882b02900eeafd87586mr99617pll.20.1620234788740; Wed, 05 May 2021 10:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620234788; cv=none; d=google.com; s=arc-20160816; b=iKm6hoUXvzg4iEKXLwhqI4zK59luZ4kFBbHfsgCFPKDQexj0huYwA99t8yE+7mGpck fhL2v6YwEeRDsUT7Ij0IdTlnJjWPJLoKyHGmaA5p00N9aGoPQG2dLuj+m0madKzznU19 lQ2COF5U50odBTsJu9oeq1t2NEfvzyQMrFdB1iU4bWCUMCAw7fcvEn4SQV0UDDBMSc56 cEySSwjrlFAO7/alNg4xEvksrL0Qn5k+6QuZA34qjFANRmu2rxINVUHKTl6zwCBM+jfI NX77j6MoBVIMoP5e+2DhOz1f2wdZRiVGna7kqx+y6p2vzPA5yUb+o8BAVR5NVEMWcYud Xjbw== 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=FHd4NZlGbrbfW6lclsw3FGeRBrQH9FqllaW3Yf7/5mI=; b=t1T1F7LY/Rfmo77izLBsQ3XeimEvniBcmgC6SO0vYOhJduHZ5aezeeZKTBraFRiWC2 wLqFs8Q9XdXl5OG90Wqjp0/Klf9xOGXDDketo0YwP+GvDhcZcAx/d182eQetgcdyd3li g6FZOFU3ELufo3bWhO3zHHYH1YoUjCMIF9xF49VcNTtWrT5lNDCsOq9shyf4sjDd62GE bo6YxJAGzJ1wGtQW3btWCxoIf7EJLpJTAmyQSd5lnFI8WOFmNa0IHVmLUg9qGibI9Va8 9e9ZoIzYZxLmdGr/IGaZjIjqeAPrXySWvO547JaZ6MOqM4J668jIHJB8ZRgoXM9525hX o1+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H5o21YDA; 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 14si8377008pjm.72.2021.05.05.10.12.55; Wed, 05 May 2021 10:13:08 -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=H5o21YDA; 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 S237246AbhEERMF (ORCPT + 99 others); Wed, 5 May 2021 13:12:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:44946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237115AbhEEQ5T (ORCPT ); Wed, 5 May 2021 12:57:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 705FA619A0; Wed, 5 May 2021 16:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620232764; bh=wm62CXnlQlROjrFU1xBW5vxum5weK+uKY4uM6pJh2/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H5o21YDAU6QursZASpxVnB9g91EyXQC9hkih0XkIinJyA6JumS367l7yo44Dw8Pg8 sG4fKBIIy2GBtvN5IRbUe/VGznQLN6KqP9JNaEWRApF9/xIQZLu9aYlB2DptSkUnCx Xh1q7AxWdfuWKyd9GWg/381WJRJP4TNlSL0EWrBW1eOnWlwr66OQz9pvWpWe3rmpOi 6se1deD73sPNaUGf8eRmwuaygIkGDJwskJ5dgoAZ7Zo3SNX8y2jfKjnx2xSQBV2D+l wUgPYusV0pIHmUMkAk6YOEalHjMYQihDeQt4PuqdnFIzVMO9pPzaorMhu9LhDrMwz6 DOCTV5mQI+GgA== 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 5.4 19/46] mac80211: clear the beacon's CRC after channel switch Date: Wed, 5 May 2021 12:38:29 -0400 Message-Id: <20210505163856.3463279-19-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505163856.3463279-1-sashal@kernel.org> References: <20210505163856.3463279-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 17a3a1c938be..44fd922cc32a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1215,6 +1215,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