Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1666194ybb; Thu, 26 Mar 2020 05:13:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuYU2SceNt8ORvKj335787nEjbbBlvQBMeAH3L5MliLoLLlvYGUAPOlqd8Gm4RY8w3OAA5V X-Received: by 2002:a9d:7607:: with SMTP id k7mr5965420otl.205.1585224799217; Thu, 26 Mar 2020 05:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585224799; cv=none; d=google.com; s=arc-20160816; b=hNDV8gHMBYJ/wzbKrjQqOhn0x5h69YauGEimH4VzVeo14TPMtel6SVuqzTjjdoLSE4 CLH0s0mlBHeA8I/V1UN9bDXIMPVrU4Ml3ut01Ps8mF6EA72cNsl1x56M5tRGSCfH+HKG 1c1vtUdsWHEnCIB//kXIPe/PtpOkSkTbaQrm3IWVzI1EGxcF7WE95rH0T/5aUGEGG2o4 W3U3zdrjKORiQuYQ+YEEz23spFgQo7lvlOkUioXVBVjXhlES8cs1nIhIY2jl1xmqScM5 qQevUExFnSEWa8vk4QKaM1Xoczilq9v8jjTZm85reo8szb23C2ySjjBRqHDHIPacwtfV +gyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=r173jmWxXH4oYkl/zEz/Rq9S24yH0mNMbKBGFJsgtnI=; b=qjibWIlwmMZHjO60pqmQ7Tfv8G+oaQz1rGZHEakRM6/Mlp4pRaJu4ZniiSE/EnGvKN WpG7c6Grs44GEHCK+5ot36+xjHggzgpnA3MN6H+bO5aRmD61X1ZnFOs4yrpJDRYi+2CL deMf1bNdP92Rvuaf2FMaC9nqoUpf0nYRalvXYtqbkqgxM8feZx1SBGTGfl3q6ITFSoIv xUDqYksKGEGf2xq8fndcWuxYeC+cJ492Vw8749q20AnAh57iBGOFlvpG/Uyorwo/nk4m 7PkJ5K4AcEDP7s0CiAf716P5iMeLcmsRLFDNWvTG0eNJRhXISeaGoEWr7dMQ7zlfp13O 0Vwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y67si983085oia.184.2020.03.26.05.13.05; Thu, 26 Mar 2020 05:13:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728199AbgCZMBG (ORCPT + 99 others); Thu, 26 Mar 2020 08:01:06 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:44134 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728001AbgCZMBF (ORCPT ); Thu, 26 Mar 2020 08:01:05 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jHRC3-0003we-1I; Thu, 26 Mar 2020 14:01:03 +0200 From: Luca Coelho To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Date: Thu, 26 Mar 2020 14:00:38 +0200 Message-Id: <20200326120042.578777-9-luca@coelho.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200326120042.578777-1-luca@coelho.fi> References: <20200326120042.578777-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.4 Subject: [PATCH 08/12] mac80211: Fail association when AP has no legacy rates Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ilan Peer The MLME logic had a workaround that allowed to continue an association with an AP even if the AP did not provide any basic rates in its supported rates in the association response, assuming that the first (non basic) legacy rate could be used as a basic rate. However, this did not consider the case where the AP (which is obviously buggy) did not provide any legacy rate. Fix this by failing the association, as this can result in an unexpected failure in the low level driver and FW, e.g., in rate scale logic etc. Change-Id: I6e6ce5efda351a8544c0e7bfeee260fe3360d401 Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho --- net/mac80211/mlme.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 04ed883339c7..2b57c53ab070 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5037,8 +5037,16 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, * doesn't happen any more, but keep the workaround so * in case some *other* APs are buggy in different ways * we can connect -- with a warning. + * Allow this workaround only in case the AP provided at least + * one rate. */ - if (!basic_rates && min_rate_index >= 0) { + if (min_rate_index < 0) { + sdata_info(sdata, + "No legacy rates in association response\n"); + + sta_info_free(local, new_sta); + return -EINVAL; + } else if (!basic_rates) { sdata_info(sdata, "No basic rates, using min rate instead\n"); basic_rates = BIT(min_rate_index); -- 2.25.1