Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1065831ybl; Wed, 14 Aug 2019 10:09:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH9CfjixXkua1IJCsqLTT/yeU5TtmEk4rPysIWqkMpVD5x5qjp4ljwSxlOVTbYiTynxiL4 X-Received: by 2002:a63:7709:: with SMTP id s9mr193646pgc.296.1565802560936; Wed, 14 Aug 2019 10:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802560; cv=none; d=google.com; s=arc-20160816; b=FAHG6GeIuNJDhiXY9ltcz5uYr7AgzXv2TFLXCV6oTRlegkN5i44CVph1Khk5cLB/Ri 6O/isFAdHpngJ64e8TGpjzrPOSyDduZlWTbk2Oe76KLAbpYQKIOWaQzDeUzq0Gf9SN+X oGqAUDfUxkizo/9y4Ufz4VJVZQI9wHkTfwzPgiyb/p84a7B/oYY1Uu1Rln8Y04b/9CSk Aewg9xlSODy0KbTfuZ0FhDizRQ7eEJGDDrYhRnsV/Wvf0wVuny0CizK/ICsL05zMYEtH K4iafQlHLXjAKz9dNOs4ooFS7XFDcbpo+ft05RQcsSRV8kjvpZ7VqsnBMkiRIBzpyCMl 1BUg== 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=3jTV3pDePSjXYwUm91oQThIIXNDJnMI8uTkupw60zUM=; b=kVF2/L311lD1Z1oESO9v55QjhwKbcK1SIJyYJ2rqsk1RY2CT1+Rwq12PlQKDF5Sfaj siWE1qEdQtaF2tWO8CxoBZDFf7aDVtselVemXg8mNJG7pD6Zalyh1LNwocFvZbLSy3bn OoTlevMw6+MCVSzhxe1pQHwxvhL/vzaq1cuydxgw3K+AwC6tfsoCMnYXXQu1IpXShMuY OPRc8JwALF73JZG4DAuOfew45JfrbK+xO9SPxbjYsGHCTyLu3Gf/vl7CCyBj8YwL1CTK DayApgrPCWRDMciEJBY6+vxTKlGUsrixgunS7qUqmOwmdpej+2mnXthPzKZBLuRYl5n+ 2XWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BlhYYFWw; 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 x6si171173pgq.473.2019.08.14.10.09.04; Wed, 14 Aug 2019 10:09:20 -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=BlhYYFWw; 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 S1729994AbfHNRHz (ORCPT + 99 others); Wed, 14 Aug 2019 13:07:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:57606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729980AbfHNRHx (ORCPT ); Wed, 14 Aug 2019 13:07:53 -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 38D4D214DA; Wed, 14 Aug 2019 17:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802472; bh=kAm4ohhZC+0F8W3LOXxiYtCRij/PuuaITNK8B6OR/Bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BlhYYFWwfO2eUn7uSShKCFlxWkMNB60hdceQZ0M21Dqyc4nToW/HgRNtsZaofcOB9 vv6Frfkemxs1vXO/9yixdmWPx940iKJEW4aEh2qssUuGfgq2EQw5GRWxnJpmhat1G8 HhGhz42MQkHmumMUvwYFPpvJmjGM5zgLBnT9o65E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Kalle Valo Subject: [PATCH 5.2 139/144] mwifiex: fix 802.11n/WPA detection Date: Wed, 14 Aug 2019 19:01:35 +0200 Message-Id: <20190814165805.774794378@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 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 @@ -124,6 +124,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)