Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1069999ybl; Wed, 14 Aug 2019 10:12:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSSHwyMkM7uYCCE93SIP32Unlj56hxhs/Fc1P6qmKe00I3vVaI3zDEUbJPrUnYB1srH0Ax X-Received: by 2002:a17:90a:bc0c:: with SMTP id w12mr661094pjr.111.1565802763140; Wed, 14 Aug 2019 10:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802763; cv=none; d=google.com; s=arc-20160816; b=TCVkMmGuBi7dvYIcXTRQY5fAxmWPCrRdCVEvbg8X3fcTs+oiVchVHe/TCuZXblGRTp kqqMweXm4YDbBXEMEMaEOaWXo5HnsZew6fGquN1OBPuRpWg+t0sHHSCUgi+EOF0r94Da XmcCUO9qA62blvSRZqIRXEWym5Jr9L/1AxE5zsne7z4pgDa4+I/AEsy14BZZgRmvvPYQ NF7jdjQekylRu84JhyGah/BH5D3MfTiBmWvPDF2hvgvPUoxWqY8zDcit8uOcnbZOfr5k J7lz6/5P0V1tJYB+r7TK8D9dUqhy96ECNq8hiVOSeemhgAiakGVU/VxuEZJ+nSgVBMGQ 1MzQ== 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=iBZ0Vok0G3N+8z9LD/02iRK/v5BR/4X/tgbpnqcL5YuBzj0bOu8W9eLSXbSEP6dSiw yZUe44o8bi9x1lH8G8WpGs7mG7am5S2N+uCZVTRTLZRlPORZoDc5SAuID2OgJH/pYt4B 0mMISn/8ELUFU9x4ZPuVIvNnGl3PXqBhPexrTlEZ4tfxQrr6lTsQBdsWnkR+kRQ9tVUy VgXYNkSCicO5fwLnrv3zZhE6uUWHMAuyhxNKUOYe/yG65BaT4vgBvncT1LIITqykcNfJ aRqA+TWTMthquxCMwv8VdSm5to9mI5aXrU0ZCuRQTe2mKfhU14cgCG9/vXakNp35uTKR sIlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=icJtLIpb; 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 b5si167163pgc.396.2019.08.14.10.12.27; Wed, 14 Aug 2019 10:12:43 -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=icJtLIpb; 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 S1730643AbfHNRLz (ORCPT + 99 others); Wed, 14 Aug 2019 13:11:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:35386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730636AbfHNRLu (ORCPT ); Wed, 14 Aug 2019 13:11: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 0B25F2063F; Wed, 14 Aug 2019 17:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802710; bh=kAm4ohhZC+0F8W3LOXxiYtCRij/PuuaITNK8B6OR/Bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=icJtLIpb6gIuEfVhAaaXwQFQl8rjfEbs/Wa4UWPF3EEip67visre8SmB6FTwT+MJ2 QlG4q+U1PIIPR8N3419BvlkTag/59jz5I4yUzqYpkphy4iD3569BUXjTJfSitiyfSb votkHomG0FkRfmedNt/0Ftt+9xHoez/wxpOg31hY= 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.19 87/91] mwifiex: fix 802.11n/WPA detection Date: Wed, 14 Aug 2019 19:01:50 +0200 Message-Id: <20190814165753.885582541@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@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)