Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1069582ybl; Wed, 14 Aug 2019 10:12:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/jZvyChQTUwE3b61J5swFg0M2/4CalxCnfRHujSPwJ2yZbv0tAHn9gR8CZkDlC0zYNK/U X-Received: by 2002:a65:638c:: with SMTP id h12mr197960pgv.436.1565802743965; Wed, 14 Aug 2019 10:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802743; cv=none; d=google.com; s=arc-20160816; b=U0rEmCppruamEWmgT2s1HV/8yhyLRlxTaugtHACC0ESnN54hyyiRO9lHyaD5ktm00a KdwbshmCF1cVqFP8ubrOIk6tgOAPhRuM/mAqHnvYtmsNJFx7qzB1PBBD5rwLUeY9KV9s tfmKDqfrPMvNV64gJC6zw/IhbI3sDi40WpZPmh1mWur369ywd7K7UBoL6YKjoWw9nFmx 5AIfYYX+mMarOwLQfKzi0V54SgWJhBE/Wm8SsPMl8zEFHPsyreI7C0nTIJv29wsdtc58 v9xXLX06uzYTSICmXuPL5/RikLyYlEqtTyG4B3w+ifpPKBpLjNX6cdKyoLP2NyoF7wIl xn4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xv3QSvREHK0/O4pHbVlClajBzMOEHx/ylDoiaZxBbDY=; b=0BRj7C7/e6FkkQ/VXg6j7uyqY8apkH56nvoMKpIzMBRVG0Zh8zkzDgkY5L3WE7T8zi YZ3mObSz9S4HLTNWlvtLF369naiZTfjDh7P77/ijRlPcevKdKgliCeB/DqgqRzfpOpPw dqQKAfBBcGl787NZnVrI7xL5U3lj9yQW8ZB7LXfNPbebZA51IARVM0NmWKFVPZcnhMBk 0V4j9SM8jh7rW8pEp4ctmclTAHIYciPy/gejzqPhX/Q++5ls49lxZyctDkk2DUHkSoIt /iHDX5WylzuCsZWpTtd14bliVl1ozxsSE4gGrthBnlyg0Rz0j+qy27/emYKrkQPflHYg PGoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="GWc/UfOq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 c13si257723plz.242.2019.08.14.10.12.08; Wed, 14 Aug 2019 10:12:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="GWc/UfOq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730611AbfHNRLh (ORCPT + 99 others); Wed, 14 Aug 2019 13:11:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:34920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730600AbfHNRLd (ORCPT ); Wed, 14 Aug 2019 13:11:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F4932063F; Wed, 14 Aug 2019 17:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802692; bh=bdObPI1OJMypCJtsoRUD1393dX3YGyQowE571RDecP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GWc/UfOq6Ast7w4gtKSgdkaUedHuzkh+wEu8J/oFvX1ELDWhkhybYqhRAmiHnvZVv BzlBrWqwRMjOYejQnnSI2Gud4Y7NHPLlMbQ2MU1Pf/s8jS/Pdn+H25LuY0gW4yz8El HVlobmsLogjaWTdF/2m8Ok18C7xE3KeYWrVoGvds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Johannes Berg Subject: [PATCH 4.19 81/91] mac80211: dont WARN on short WMM parameters from AP Date: Wed, 14 Aug 2019 19:01:44 +0200 Message-Id: <20190814165753.421691369@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian Norris commit 05aaa5c97dce4c10a9e7eae2f1569a684e0c5ced upstream. In a very similar spirit to commit c470bdc1aaf3 ("mac80211: don't WARN on bad WMM parameters from buggy APs"), an AP may not transmit a fully-formed WMM IE. For example, it may miss or repeat an Access Category. The above loop won't catch that and will instead leave one of the four ACs zeroed out. This triggers the following warning in drv_conf_tx() wlan0: invalid CW_min/CW_max: 0/0 and it may leave one of the hardware queues unconfigured. If we detect such a case, let's just print a warning and fall back to the defaults. Tested with a hacked version of hostapd, intentionally corrupting the IEs in hostapd_eid_wmm(). Cc: stable@vger.kernel.org Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20190726224758.210953-1-briannorris@chromium.org Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/mlme.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1967,6 +1967,16 @@ ieee80211_sta_wmm_params(struct ieee8021 ieee80211_regulatory_limit_wmm_params(sdata, ¶ms[ac], ac); } + /* WMM specification requires all 4 ACIs. */ + for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { + if (params[ac].cw_min == 0) { + sdata_info(sdata, + "AP has invalid WMM params (missing AC %d), using defaults\n", + ac); + return false; + } + } + for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { mlme_dbg(sdata, "WMM AC=%d acm=%d aifs=%d cWmin=%d cWmax=%d txop=%d uapsd=%d, downgraded=%d\n",