Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1074862ybl; Wed, 14 Aug 2019 10:17:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx10kxN92JXcZHHGdTRsEB5dithumaKP8c3P6mUQBLLaYgOFMNbM0Zth+GpCaGF4oW2Cl3T X-Received: by 2002:a17:902:2aea:: with SMTP id j97mr419087plb.153.1565803031639; Wed, 14 Aug 2019 10:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803031; cv=none; d=google.com; s=arc-20160816; b=LY6FFFOtRinwBYVRepezCuw3BwuiH5h1j1+wP5danp3qBh3iTpt/qxSGg364LgMFO6 h75XMzpvhE9G8vjTZX85bjNDmDCEB3cxjBnHQ/HvTJpRogbs507phPNqzS58oVube2TU jsVck7l6+jM87VOL3BUva7Yr8Ix3ctGvCGsD+y9etTOYfTHQ8ljR2kvHS/dcqKtZCqrt tr2OfSHI/7FzO6BYyE1lA3LLKidrPl0snNiC13ldPRXNpE7Pe7PQ/No2UNGVmifpDOP7 IoxlIvZQ1NQGSCXIl1MUqmLnRFyUUCq0uLumo5TbeQtq+TBVJoyzCvOaWimtTAZ/xQ3R 16XQ== 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=S11IGBqgORVWY5tL9rsVZ+cX41Qgx318+wTWSDzeSrs=; b=LE0jNifxFqF/x8UHJEsvqewm3MBThVAD6dgnnDHZo82HgUhauwn5+6oqTcVI3FMDeG ojmQu6BR6s7uKvqUK2U71tKPZfSRPAUcJ8o36ZkSAN7+OqP9klcdeulAMXcC/kqHuKK9 vagRKztUO/G0R0AuRAp8z2jbpa6aYND/IJF0t3fMI20ALiRJM4weO2ED4e7HtFW0dkmF GJxuScsTjL3TUN5pZE6vjg3GIiUTE/T16kgEGZdWtz9pKkgtMfaiGEKuGLoDabq6jR/G y8aFkE37+X5PolHHKI5HaKN76D2g7IsXfCxuqykiDw0oFJmHqhlV26/6BOiFLNqrVM8J IiOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vo3dtpT8; 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 c4si158280pgk.257.2019.08.14.10.16.55; Wed, 14 Aug 2019 10:17:11 -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=Vo3dtpT8; 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 S1730964AbfHNRQX (ORCPT + 99 others); Wed, 14 Aug 2019 13:16:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:39034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728886AbfHNROc (ORCPT ); Wed, 14 Aug 2019 13:14:32 -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 F29BD20665; Wed, 14 Aug 2019 17:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802871; bh=WWdtclU8aMzAP9fCCYl2gNsuul0ymzZGOQH/w5oVOgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vo3dtpT8mji3o1EI6ZQdFvgE9P0v1aEaU5CUoo0Q30RGD4jzy7EbZXsKfDzGmtjBl E1KfJIcQjnCYnUeWDdcbN34tL0SavRzdCLEmZ1vbXW+NnwNTfI4s6ZPoX2eFOCQg2L rP/1Jh0LGbgQufiDTrRswr4pxI6jrvxKVQPnuiBE= 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.14 59/69] mac80211: dont WARN on short WMM parameters from AP Date: Wed, 14 Aug 2019 19:01:57 +0200 Message-Id: <20190814165749.524255625@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165744.822314328@linuxfoundation.org> References: <20190814165744.822314328@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 @@ -1867,6 +1867,16 @@ static bool ieee80211_sta_wmm_params(str } } + /* 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",