Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1083513ybl; Wed, 14 Aug 2019 10:25:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWjTkT9h4AS91/EP8QHQ5Oa/rhnDMPdAeTwx3aumezZfXi0UEpZzMNNGM7cfgM2qqNPSzH X-Received: by 2002:a17:902:8d82:: with SMTP id v2mr505322plo.24.1565803537618; Wed, 14 Aug 2019 10:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803537; cv=none; d=google.com; s=arc-20160816; b=YFyaOuSc7bXE0GYbmCFCm/ejeJOfr09dnzOPE9bR1JdIsyZb3Hxr7/UnFxkjawC9fF 1ARvZXUcuW4BGu1bKTCNK3/xj8eZEGbYaOMO7hlkr3R1N61ko4o6V0RAX4MhIN6jf4Iz KlpRHLLRNiawlrQ8tk02XhIUfPh9E2f7vm4r1Bm0TLkjirOA8HFxXjVay4O7iQmYrFVE 1tReDUGdMYBpzwXN3xHUUmWenp+DC9AJ0G8RXT6tgSpDyDZyWI3n3xEBmUT1cGJUH+8J oqQoZ/IFVc9Y3bdkx2+eYJGLnNFAT6+GXFLDAZWYDyQiWW66ClQuFnwYxuOhe/RzBN+Q xS8g== 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=NKrsT11PyYu8kk6o708PsJGUJgJWmepCcl2RnfUOfJM=; b=yVXDyix8TWIjtK1iAi1uW2u/pGIJ32SWA8gsWLe/xpLRZXRb/sR2ZuoGZNFVQ9fKyK qQeFecXJw6m4FbbmM9y4JbgBOnugvI364eBLbsn0S5/soghXMGIYMo+xqZVrheknC02J 5lsQYFzGQUsqMhDHReXLC19wxKSvcw3t/oZC87tjvbrvS5B3MRufJirYE7ed1rQ+C7OJ YpoZN1D+9mfh5dgDTSaES8TeWDaMJD9WbEXRTy/V6igkI8y2QT/JcHjiqV6TCFDw2aIo 2gum0Z+tGcwdNuQ6Kd2DyA7x1MMDtDit0Kak6drHycElAelUgyN5gJGK4KNrB+VvUIHh grrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ccom8LSA; 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 z35si193547pga.42.2019.08.14.10.25.21; Wed, 14 Aug 2019 10:25:37 -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=Ccom8LSA; 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 S1729893AbfHNRH3 (ORCPT + 99 others); Wed, 14 Aug 2019 13:07:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:56990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729394AbfHNRH2 (ORCPT ); Wed, 14 Aug 2019 13:07:28 -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 B1805217F4; Wed, 14 Aug 2019 17:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802447; bh=WHKWy/SELvbnwK3ZMPJTjrcQrATzISOSMmmKEDqbyOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ccom8LSARbMc2W7EjkGLDfKbWzrhoS2YdrbaxGwDGZP5UHurLQx1vjXX1vWJd6GF7 +61HwfpCTCuKhylXmMu/UtVa+n1iGfeZ09avY25YXVxYH8VIxKhiAvP1ie10TxDuXz ssjw8lSNdmPR/rOKea2uyGhKmKtxAQRkg4f76Y4k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Johannes Berg Subject: [PATCH 5.2 130/144] mac80211: dont WARN on short WMM parameters from AP Date: Wed, 14 Aug 2019 19:01:26 +0200 Message-Id: <20190814165805.381502877@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@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 @@ -2041,6 +2041,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",