Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3423948pxf; Mon, 29 Mar 2021 01:39:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySHsKJDAhHa46Jy/7UXWQoh1MruWRobG2NbUsd8fwQX8mNBfBwiV9FqwUndsfC9bm+ftwo X-Received: by 2002:a17:906:1a44:: with SMTP id j4mr27909007ejf.401.1617007183945; Mon, 29 Mar 2021 01:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007183; cv=none; d=google.com; s=arc-20160816; b=1HEGCq7nkg4lOazF+lZM00dzrUNOClvLlEgD2x3xb1VmRXR6sTrCSeQicYAqqnAl6U PhtunwWA0jGGpKzrvPknYLwuWNQuI/Ox1BMYf5HI6LJsOyRrgHIZVN156fOyzzUR1Mju TIsnvcjLMaq9TeG3dSSnUIE9FKIGJeRIYRrA9ROwsOGLNmYUPa5Gkk3uKpIphgVx2tid upmYOjHCaj2pSGbLTsG8fEzaDONPylnXSjq/lpL7UmFbtiVlls2XNlkxozv93mmbNlvJ JEveF4jzbsozSlmOk3enUxNVa9VOqmuEeRqWFTs9p/QX6TSkMvvtOZu2TtJ9rHZ2OiLP XjOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TF6hjAhrvqfYqSsJvtVfh2f5Tf2YEfflVDYo9SEGlyg=; b=fYfy2uLoqEgFnhV260vjne3Q8Zm3IS17Ha1tM/NT1u1aM5j87VTcomIYlVXJKaAl6P /rv5ZKMCLrMYSxHWLChSegFJYaRi1HI4Bpw8vnfHLHtG8Z4Xgg/VZYnMwcV9JYaS4ErI 76CS17ym17+Uk7VBZfruM8D+hdwitNVO6YqC56L3HYQIh38Jyibd+GDnnJCoNxvaS+dU GLwAeeWL1joI8fFp2wjbVnAMhea4IjQ7PPZmftYBx06u1XKq0Reoqi2/EM3O/uWob25Q zuADf/ItZu5g+kYDhznGtv6y159gVMPmg/1XxaxFVzKAgJVh3EmzfbO46DqiZ2zzgX8E VWQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=niM1gtc6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si12012156ejf.752.2021.03.29.01.39.21; Mon, 29 Mar 2021 01:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=niM1gtc6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234376AbhC2Ig4 (ORCPT + 99 others); Mon, 29 Mar 2021 04:36:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:39290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233955AbhC2IWj (ORCPT ); Mon, 29 Mar 2021 04:22:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C06761481; Mon, 29 Mar 2021 08:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006148; bh=k5mP0sVan2kKjq9ykLRDakpWtYP4u8P/RmMM4RnF5iI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=niM1gtc6f31r2wQ7veYIl9ZEXZ/Xu0m9jYir51vIJPQI8yZ+QOrRr8vUu9EwWOZbE owyrIVJR7oK5meBFteFMez5i+EACMwpqk46I+qxuIsiE1BB9uS5/g2SkBXTjbJTlWy 6qVDrzeVBLwQI/AJc9Gq8Z+Dv9wKMLIQKI2zHuKU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Yen-lin Lai , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 134/221] mac80211: Allow HE operation to be longer than expected. Date: Mon, 29 Mar 2021 09:57:45 +0200 Message-Id: <20210329075633.661629128@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian Norris [ Upstream commit 0f7e90faddeef53a3568f449a0c3992d77510b66 ] We observed some Cisco APs sending the following HE Operation IE in associate response: ff 0a 24 f4 3f 00 01 fc ff 00 00 00 Its HE operation parameter is 0x003ff4, so the expected total length is 7 which does not match the actual length = 10. This causes association failing with "HE AP is missing HE Capability/operation." According to P802.11ax_D4 Table9-94, HE operation is extensible, and according to 802.11-2016 10.27.8, STA should discard the part beyond the maximum length and parse the truncated element. Allow HE operation element to be longer than expected to handle this case and future extensions. Fixes: e4d005b80dee ("mac80211: refactor extended element parsing") Signed-off-by: Brian Norris Signed-off-by: Yen-lin Lai Link: https://lore.kernel.org/r/20210223051926.2653301-1-yenlinlai@chromium.org Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mlme.c | 2 +- net/mac80211/util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6adfcb9c06dc..3f483e84d5df 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5023,7 +5023,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, he_oper_ie = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_OPERATION, ies->data, ies->len); if (he_oper_ie && - he_oper_ie[1] == ieee80211_he_oper_size(&he_oper_ie[3])) + he_oper_ie[1] >= ieee80211_he_oper_size(&he_oper_ie[3])) he_oper = (void *)(he_oper_ie + 3); else he_oper = NULL; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 94e624e9439b..d8f9fb0646a4 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -967,7 +967,7 @@ static void ieee80211_parse_extension_element(u32 *crc, break; case WLAN_EID_EXT_HE_OPERATION: if (len >= sizeof(*elems->he_operation) && - len == ieee80211_he_oper_size(data) - 1) { + len >= ieee80211_he_oper_size(data) - 1) { if (crc) *crc = crc32_be(*crc, (void *)elem, elem->datalen + 2); -- 2.30.1