Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3010643pxj; Mon, 17 May 2021 15:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzbK7D6Fp2jUh11VxLR3DNepWZUobEdveLCYovoxrWO0mUBhmYE48YXTAGLASngUyY72+o X-Received: by 2002:aa7:d659:: with SMTP id v25mr2773806edr.271.1621290635076; Mon, 17 May 2021 15:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621290635; cv=none; d=google.com; s=arc-20160816; b=wb1ym3vZMWjfc50mY6Ui3TIb8NvQ1JUfOXx9bbqmqUMT/0TQiqXcypCWntpKW95r8V qQi5zpCj/NEB3yqslx6w9LKeWiMEx5wW+6gASOJ5aJs/kyySFZPeliUyMO0pxMduLWfj 8WgDXzwlq2U89+ynTG9g0Da19VYjCznyN0MzCWiziwhTKswefZ8kwgiLKzgyhaSkt8PH pTv1oZJQTB0V7acOF5LQnve0ShPk2lH+n5eSppc6qiysrPYbKr4KjUafX7DCwCG2q7p7 8+/8WV6FTTGwJzk8vw59RpqxXwOCBIYUCjfleAaUcJUblCcWPH3i16amvQcVx2+4FEYF wmoQ== 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=lZshktu3Q2vEVWYHSnXITyR+yM3KkpI1TtDdAMI160g=; b=bmnOaJ55Osh6uPk2He/AvQX6CgjPvdx2oQV1VReiDmJlaCJGkeFxeh/1qE3hxAo1Ng Pfky65JVOZFu73Quuuuxl/rK0KogInx3n0MoX/Bcp6iETxTAXGBOS63HGBKXEs49RlAN R0hgqJ+N8jWIaO2NnExuCkHorbpGzf+vi6rpvGoSekRUH1vFxF5fuL5g7PLFoPLl8z6J YZPMVBfp4PEpHvadVCWo6vkJSbsnAbgSK9NIeliuygwcj1iX2I9MLBTZEOVMLsWafUBr XL+78g6llMhLnEWU4qSGPz/SRN/sW1rGO45o5ibVmsc63ayl36EyCCaZyPJoCgT+izr+ jbag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H1MtkEiX; 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 s10si3905920edi.167.2021.05.17.15.30.11; Mon, 17 May 2021 15:30:35 -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=H1MtkEiX; 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 S236898AbhEQONz (ORCPT + 99 others); Mon, 17 May 2021 10:13:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:43802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236810AbhEQOLx (ORCPT ); Mon, 17 May 2021 10:11:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F3A5613CD; Mon, 17 May 2021 14:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260474; bh=9yRxJ3VaWxPObwoymsEDUnFiROCK5q5GXBmdx7K/05M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H1MtkEiX3nVxVLXWws4TBZQSVmnbM+IL3CcljFjMevHasqgGMPL9RN4nOMQb9SB2T 1g/4BH1tStEm2WsE8GnvTywKxfaD39FuhzSohmR68Rq4sVdUFzA9n6DA+TGzWwtmT1 5pIQdYKFYh0A2hr9FRqVUrF7qg43HD0EQkyc2buA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emmanuel Grumbach , Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH 5.12 096/363] mac80211: properly drop the connection in case of invalid CSA IE Date: Mon, 17 May 2021 15:59:22 +0200 Message-Id: <20210517140305.842966055@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 253907ab8bc0818639af382f6398810fa1f022b3 ] In case the frequency is invalid, ieee80211_parse_ch_switch_ie will fail and we may not even reach the check in ieee80211_sta_process_chanswitch. Drop the connection in case ieee80211_parse_ch_switch_ie failed, but still take into account the CSA mode to remember not to send a deauth frame in case if it is forbidden to. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210409123755.34712ef96a0a.I75d7ad7f1d654e8b0aa01cd7189ff00a510512b3@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mlme.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 4a8f1b8ce768..0fe91dc9817e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1405,11 +1405,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, ch_switch.delay = csa_ie.max_switch_time; } - if (res < 0) { - ieee80211_queue_work(&local->hw, - &ifmgd->csa_connection_drop_work); - return; - } + if (res < 0) + goto lock_and_drop_connection; if (beacon && sdata->vif.csa_active && !ifmgd->csa_waiting_bcn) { if (res) -- 2.30.2