Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp151696pxj; Mon, 17 May 2021 23:39:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhMw5HwgDVqHuQiDHz7aQdZEwhZuPjax4bLR5hRRxg7MuGv8k7btJnnma/eXzHS9x3u+qM X-Received: by 2002:a05:6638:37a9:: with SMTP id w41mr4058424jal.12.1621319990634; Mon, 17 May 2021 23:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621319990; cv=none; d=google.com; s=arc-20160816; b=SU7B2C55neQhF+LVyuXV4dNDKJOzr47X8wrT6PFFMopOZQYB4TLJmkAYt2aYUGJXr6 84Yt6f8K9xQlo5v5aHWbdCbNJnSbchDx44wHJLPIMy+ld2lV5dQ4L1Py/4p1TW3fp6Mi SeNv/TsE3OGJ1srjJjOplQobTwP9M2TQq6k42GYApLc38Z4YSUJtPVRB8K54nzuDx0Tv 2AFt45dD6kDHaetITp9+50UIw9hF7B/bspepue7MeAo+QDLAkuE61RDRzTYEjkrM7QKz BkURdpmxtBZ9uG+5jGbSIIuUxR+t4n+/SXfJbzFL8i7j6ggNUMUVBZIkkwPGsLuWMqTS pWIQ== 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=XUP6OoHqRZpbPP+g7yL5yDP5jupaJkFcGGq/bOnpl40=; b=oLEsda3G/Pj03imyGDsz6kBXiaZJbipLrlakoCMSwRy7pgGiKF+6smGQdYQ8opWB3C BboJdE6+BVWO6lpU6kTr4p4r6JJniJshZPOav5P2H1rQv5Lrd+pQQENGdGmocJuzhoYT 25rtfX3Xh/b8C2uK3rt40ggtlXjPINUOqSOtf2w7MbClw5YnuBSZb7ApyvxqS6gIZqdH caHVZLNNCbhj9by9sKoCEVn2MF5OngV6ZRGy9pd+g6Fh3jhVzwHG9Pbk/PI0lCLGgY65 OSpzH9YaRKk/kc++2VUckl7qijLyXUaE58y/tbMjyLQD1JALrBkffEqhjmA1PRBT2qSA ACtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p6SMgUbR; 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 a7si21923297jat.120.2021.05.17.23.39.38; Mon, 17 May 2021 23:39:50 -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=p6SMgUbR; 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 S239842AbhEQOuF (ORCPT + 99 others); Mon, 17 May 2021 10:50:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:54300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241227AbhEQOnX (ORCPT ); Mon, 17 May 2021 10:43:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8453C613B5; Mon, 17 May 2021 14:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261221; bh=mhTW7ap38pUqicSAQA9CEMmiuWNfQtIjQmf9McsxMc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6SMgUbR4m8ym5X4WZAf3oOALQ8AgEGVdqGrHciB+HcWyWVJf9lXVQ5TkfSnRbYd7 wjVlXNLCivO0ljDfTwv9RsitgCpBUFufuraHUpDBp+A1m7WrjC7gni/myhwH2a7O05 u0UCksXW0d92oXI3Yp3un63tE3lY2MDL8ImSeDhc= 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.11 086/329] mac80211: properly drop the connection in case of invalid CSA IE Date: Mon, 17 May 2021 15:59:57 +0200 Message-Id: <20210517140305.028957549@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.043055203@linuxfoundation.org> References: <20210517140302.043055203@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 c9eb75603576..fe71c1ca984a 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