Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1073275ybl; Wed, 14 Aug 2019 10:15:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZVg9FVPMIp8LkxWMoeEYxHeyjW/3bGzhlucq9fFtGWSsWSV626h5ao7iJ0Zg9nX2p6oGg X-Received: by 2002:a17:90a:380a:: with SMTP id w10mr736953pjb.138.1565802942541; Wed, 14 Aug 2019 10:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802942; cv=none; d=google.com; s=arc-20160816; b=kR0GIGPniO0bjtroFZKzYr5K579amiOy9V+UtQ0POpB5ejUlUAXQEQ3W7d2DqMhuCL b6MtW1PCuiKZNPMSPFVZY6Srr8J7ZsGTm3HCm7gF1TIv5ZyQRvo+hWKotJmZsYbJ011I YE4s1a2lkHNDzpIn8/xs2uzkSpX0PRuuhkYDtF/frajf97k3YUoA0GMfOyg/jMWUGyv0 C7BuAY+BOwZUXT/LinPxdlFD6e885RuRPaggLz5vpA2boR110LdVc78ApTTv4xne2+52 0u7zRloLMOtJkbYFVUzhUbv1HGwF0MRFgo1jP/WL2R3M8ss4IoHPKcwmExtOMCmi13D0 teKQ== 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=omh+UJECpw2x0+i1pIIqe8ALplgvwuWnRagFiq8+fwY=; b=Ca7mYnSgZXW2zKJ58ftos1wR/HLsRvKU4jQCyjQ9+NPoZZIQ+0L8kdiUiXNeJWTweE UZJMYk8lPK2Uf4Gl1Ct5k+qW9nP49jmrEuPDwT+eyKW4jUzwAEIXgiERy5IGC3rAYIZ2 rwe8kMcwm/MNDQh8y8tZRkDGMVasbHEpYzGwJmVtVWtPZ8xEZUl69D/BijiPLkYmMxGn 5M3N+Mqz/aNdrUQavZeWXa7Ij4vpSj53yg24Y1P+mgtk5TbkEaQnCLaE9p3gEm367iCz 7zdjXU9DYW5fzuT2Xj23PMyX8a31gnKv3zeTcLjtVLJJYov8kvzZiSciFa06BANfvJ25 xCPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OHcxlqCO; 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 132si202996pgc.134.2019.08.14.10.15.22; Wed, 14 Aug 2019 10:15:42 -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=OHcxlqCO; 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 S1730924AbfHNROx (ORCPT + 99 others); Wed, 14 Aug 2019 13:14:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:39328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730907AbfHNROu (ORCPT ); Wed, 14 Aug 2019 13:14:50 -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 D260A2084D; Wed, 14 Aug 2019 17:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802889; bh=AGQBOIpQCF8aITkhXyPVwPEzllyvkhX+pQqakyPz/uQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHcxlqCOHKkY8ZHZkQtkOygNsR9v+mzKU9JXfUzYF/GBDhwkyXylzq2x2jm+5BYyh ig4Z5dVSPzVImCzwO/f/edl0ZF5XBPfs7m3ieDcxLpyKJ0/ilJcD07a7P8IWypiqs4 odz3p55SFxSO24AdhSC9BfKIBg9/boyxkOWTvvW4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Kalle Valo Subject: [PATCH 4.14 65/69] mwifiex: fix 802.11n/WPA detection Date: Wed, 14 Aug 2019 19:02:03 +0200 Message-Id: <20190814165750.429515291@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 df612421fe2566654047769c6852ffae1a31df16 upstream. Commit 63d7ef36103d ("mwifiex: Don't abort on small, spec-compliant vendor IEs") adjusted the ieee_types_vendor_header struct, which inadvertently messed up the offsets used in mwifiex_is_wpa_oui_present(). Add that offset back in, mirroring mwifiex_is_rsn_oui_present(). As it stands, commit 63d7ef36103d breaks compatibility with WPA (not WPA2) 802.11n networks, since we hit the "info: Disable 11n if AES is not supported by AP" case in mwifiex_is_network_compatible(). Fixes: 63d7ef36103d ("mwifiex: Don't abort on small, spec-compliant vendor IEs") Cc: Signed-off-by: Brian Norris Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/marvell/mwifiex/main.h | 1 + drivers/net/wireless/marvell/mwifiex/scan.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -122,6 +122,7 @@ enum { #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) +#define WPA_GTK_OUI_OFFSET 2 #define RSN_GTK_OUI_OFFSET 2 #define MWIFIEX_OUI_NOT_PRESENT 0 --- a/drivers/net/wireless/marvell/mwifiex/scan.c +++ b/drivers/net/wireless/marvell/mwifiex/scan.c @@ -181,7 +181,8 @@ mwifiex_is_wpa_oui_present(struct mwifie u8 ret = MWIFIEX_OUI_NOT_PRESENT; if (has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC)) { - iebody = (struct ie_body *) bss_desc->bcn_wpa_ie->data; + iebody = (struct ie_body *)((u8 *)bss_desc->bcn_wpa_ie->data + + WPA_GTK_OUI_OFFSET); oui = &mwifiex_wpa_oui[cipher][0]; ret = mwifiex_search_oui_in_ie(iebody, oui); if (ret)