From patchwork Mon Jun 25 01:10:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 10484973 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4BB560230 for ; Mon, 25 Jun 2018 01:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEB99287B4 for ; Mon, 25 Jun 2018 01:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A172B2886F; Mon, 25 Jun 2018 01:11:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ADF6287B4 for ; Mon, 25 Jun 2018 01:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbeFYBLt (ORCPT ); Sun, 24 Jun 2018 21:11:49 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:51893 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbeFYBLs (ORCPT ); Sun, 24 Jun 2018 21:11:48 -0400 Received: by mail-it0-f67.google.com with SMTP id 128-v6so3973300itf.1 for ; Sun, 24 Jun 2018 18:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobcopeland-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=hbnvCWqgjjvyQXCHZypjIwEmKFH/mmfN0QqvhPMFf+U=; b=QPtG9euHNun/DNLAfxW2SD/K1t6PgwE2Job/1/9iYbqtrLhrtO+0xNHiOogEz6Fs2k VDmug6Yxj51zlghzeiyZlYQ25w8L7afZwKyNm638ILIZcQNGHOpA7GPcfVziJxyB0IOq dLGYe8oTqujiFFbFletOz7NW1ZykdMNP5d57VAuYK13/DpivAKlTqNfaGdb+jBYhTcsJ m0zagUqgfe1VgfPQLa5OVqdPlIEQ1BqovQ/a2bpIbHyQ5RxTWR/9AYyNX3X6VjjOo34h RbOKNsDyqB+KCZnTSqfwsah2tqWo3V4Y2NtkNSZ4hWP9WIppJBWaZ3wCXhU0eaupkt9O h6pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hbnvCWqgjjvyQXCHZypjIwEmKFH/mmfN0QqvhPMFf+U=; b=ceNg/+ooAjuBSlIEeVIyLkJvYWV8BBEaGdC3dEeFArY93uYH1FcozVt7tK9KO8SeM0 6Xjl16g0CapPBWwBsfDwtJUsJtwwbFwI2T4J/DFW+at8vFgV9Aqg1M2ausWZJoLR1Fn4 Eowhv85oVfgWLtPuLPODv3WaVoHhwAqeM1SjWzf3Xl2dftGjke7f4NMAYZFvfnVUmIg6 2HNIgm06usnL3O4NCcO76iMQT5GldBspwawe9UdY4OuWgUYi5OSYBZjLlvye/OOjnYOC kss+xVWdvyqjYwkBdY+DoBs1ujo/2hYz15Bndf2rSoCLzM37jDOye3s5X6wnmd1gY1qs 28zQ== X-Gm-Message-State: APt69E2gXdB4xYcMyHQfP7cx6zp/Zy7X1Y9OszgMgfYpFMuVi9f5wunt qDoNwRFq4U1pn+oxTZaE9MWJCA== X-Google-Smtp-Source: ADUXVKJHQHFzrPjGN/EbEy5vYiBnd/0DBlncOTXp7Xcw1tE+Gtz7no5oKqLxi2w9OtFdqoUdTUn8qQ== X-Received: by 2002:a02:a890:: with SMTP id l16-v6mr8705563jam.11.1529889108298; Sun, 24 Jun 2018 18:11:48 -0700 (PDT) Received: from hash (CPE30b5c2fb365b-CM18593342f28f.cpe.net.cable.rogers.com. [99.232.51.173]) by smtp.gmail.com with ESMTPSA id b130-v6sm3931545itc.38.2018.06.24.18.11.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 18:11:47 -0700 (PDT) Received: from bob by hash with local (Exim 4.89) (envelope-from ) id 1fXG2l-0006CM-0c; Sun, 24 Jun 2018 21:11:47 -0400 From: Bob Copeland To: Johannes Berg Cc: linux-wireless@vger.kernel.org, kernel-team@fb.com, Bob Copeland , Masashi Honma , Bob Copeland Subject: [PATCH] nl80211: relax ht operation checks for mesh Date: Sun, 24 Jun 2018 21:10:49 -0400 Message-Id: <20180625011049.23768-1-me@bobcopeland.com> X-Mailer: git-send-email 2.11.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 9757235f451c, "nl80211: correct checks for NL80211_MESHCONF_HT_OPMODE value") relaxed the range for the HT operation field in meshconf, while also adding checks requiring the non-greenfield and non-ht-sta bits to be set in certain circumstances. The latter bit is actually reserved for mesh BSSes according to Table 9-168 in 802.11-2016, so in fact it should not be set. wpa_supplicant sets these bits because the mesh and AP code share the same implementation, but authsae does not. As a result, some meshconf updates from authsae which set only the NONHT_MIXED protection bits were being rejected. In order to avoid breaking userspace by changing the rules again, simply accept the values with or without the bits set, and mask off the reserved bit to match the spec. While in here, update the 802.11-2012 reference to 802.11-2016. Fixes: 9757235f451c ("nl80211: correct checks for NL80211_MESHCONF_HT_OPMODE value") Cc: Masashi Honma Signed-off-by: Bob Copeland Reviewed-by: Masashi Honma Reviewed-by: Masashi Honma --- net/wireless/nl80211.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f5e36a23cae3..c9ba4edf25cc 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5837,7 +5837,7 @@ do { \ nl80211_check_s32); /* * Check HT operation mode based on - * IEEE 802.11 2012 8.4.2.59 HT Operation element. + * IEEE 802.11-2016 9.4.2.57 HT Operation element. */ if (tb[NL80211_MESHCONF_HT_OPMODE]) { ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]); @@ -5847,22 +5847,9 @@ do { \ IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) return -EINVAL; - if ((ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) && - (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) - return -EINVAL; + /* NON_HT_STA bit is reserved, but some programs set it */ + ht_opmode &= ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; - switch (ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION) { - case IEEE80211_HT_OP_MODE_PROTECTION_NONE: - case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: - if (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) - return -EINVAL; - break; - case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER: - case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED: - if (!(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) - return -EINVAL; - break; - } cfg->ht_opmode = ht_opmode; mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1)); }