linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
@ 2019-07-24 19:46 Brian Norris
  2019-07-24 19:50 ` Brian Norris
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Brian Norris @ 2019-07-24 19:46 UTC (permalink / raw)
  To: Ganapathi Bhat, Nishant Sarmukadam, Amitkumar Karwar, Xinming Hu
  Cc: linux-kernel, linux-wireless, Takashi Iwai, Guenter Roeck,
	Brian Norris, stable

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: <stable@vger.kernel.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/net/wireless/marvell/mwifiex/main.h | 1 +
 drivers/net/wireless/marvell/mwifiex/scan.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 3e442c7f7882..095837fba300 100644
--- 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
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 0d6d41727037..21dda385f6c6 100644
--- 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 mwifiex_bssdescriptor *bss_desc, u32 cipher)
 	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)
-- 
2.22.0.657.g960e92d24f-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
  2019-07-24 19:46 [PATCH 5.3] mwifiex: fix 802.11n/WPA detection Brian Norris
@ 2019-07-24 19:50 ` Brian Norris
  2019-07-24 19:58 ` Guenter Roeck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Brian Norris @ 2019-07-24 19:50 UTC (permalink / raw)
  To: Ganapathi Bhat, Nishant Sarmukadam, Amitkumar Karwar, Xinming Hu
  Cc: linux-kernel, linux-wireless, Takashi Iwai, Guenter Roeck, stable

On Wed, Jul 24, 2019 at 12:46:34PM -0700, Brian Norris wrote:
> Fixes: 63d7ef36103d ("mwifiex: Don't abort on small, spec-compliant vendor IEs")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

To add to this: unfortunately, the above went out to -stable earlier
this week. So a prompt merging would be appreciated, pending review of
course.

Sorry for the breakage.

/me goes to add another (embarrasingly missing) test case to our WiFi
test suite.

Brian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
  2019-07-24 19:46 [PATCH 5.3] mwifiex: fix 802.11n/WPA detection Brian Norris
  2019-07-24 19:50 ` Brian Norris
@ 2019-07-24 19:58 ` Guenter Roeck
  2019-07-29 16:01 ` Takashi Iwai
  2019-07-30 15:02 ` Kalle Valo
  3 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2019-07-24 19:58 UTC (permalink / raw)
  To: Brian Norris, Ganapathi Bhat, Nishant Sarmukadam,
	Amitkumar Karwar, Xinming Hu
  Cc: linux-kernel, linux-wireless, Takashi Iwai, stable

On 7/24/19 12:46 PM, Brian Norris wrote:
> 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: <stable@vger.kernel.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/net/wireless/marvell/mwifiex/main.h | 1 +
>   drivers/net/wireless/marvell/mwifiex/scan.c | 3 ++-
>   2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
> index 3e442c7f7882..095837fba300 100644
> --- 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
> diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
> index 0d6d41727037..21dda385f6c6 100644
> --- 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 mwifiex_bssdescriptor *bss_desc, u32 cipher)
>   	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)
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
  2019-07-24 19:46 [PATCH 5.3] mwifiex: fix 802.11n/WPA detection Brian Norris
  2019-07-24 19:50 ` Brian Norris
  2019-07-24 19:58 ` Guenter Roeck
@ 2019-07-29 16:01 ` Takashi Iwai
  2019-07-29 19:45   ` Brian Norris
  2019-07-30 15:02 ` Kalle Valo
  3 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2019-07-29 16:01 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Brian Norris, Ganapathi Bhat, Nishant Sarmukadam,
	Amitkumar Karwar, Xinming Hu, linux-kernel, linux-wireless,
	Guenter Roeck, stable

On Wed, 24 Jul 2019 21:46:34 +0200,
Brian Norris wrote:
> 
> 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: <stable@vger.kernel.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

This isn't seen in linux-next yet.  Still pending review?

In anyway,
  Reviewed-by: Takashi Iwai <tiwai@suse.de>


Thanks!

Takashi


> ---
>  drivers/net/wireless/marvell/mwifiex/main.h | 1 +
>  drivers/net/wireless/marvell/mwifiex/scan.c | 3 ++-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
> index 3e442c7f7882..095837fba300 100644
> --- 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
> diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
> index 0d6d41727037..21dda385f6c6 100644
> --- 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 mwifiex_bssdescriptor *bss_desc, u32 cipher)
>  	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)
> -- 
> 2.22.0.657.g960e92d24f-goog
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
  2019-07-29 16:01 ` Takashi Iwai
@ 2019-07-29 19:45   ` Brian Norris
  2019-07-30  8:08     ` Kalle Valo
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Norris @ 2019-07-29 19:45 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Kalle Valo, Ganapathi Bhat, Nishant Sarmukadam, Amitkumar Karwar,
	Xinming Hu, Linux Kernel, linux-wireless, Guenter Roeck, stable,
	Johannes Berg

On Mon, Jul 29, 2019 at 9:01 AM Takashi Iwai <tiwai@suse.de> wrote:
> This isn't seen in linux-next yet.

Apparently not.

> Still pending review?

I guess? Probably mostly pending maintainer attention.

Also, Johannes already had noticed (and privately messaged me): this
patch took a while to show up on the linux-wireless Patchwork
instance. So the first review (from Guenter Roeck) and my extra reply
noting the -stable regression didn't make it to Patchwork:

https://patchwork.kernel.org/patch/11057585/

> In anyway,
>   Reviewed-by: Takashi Iwai <tiwai@suse.de>

Thanks. Hopefully Kalle can pick it up.

Brian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
  2019-07-29 19:45   ` Brian Norris
@ 2019-07-30  8:08     ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-07-30  8:08 UTC (permalink / raw)
  To: Brian Norris
  Cc: Takashi Iwai, Ganapathi Bhat, Nishant Sarmukadam,
	Amitkumar Karwar, Xinming Hu, Linux Kernel, linux-wireless,
	Guenter Roeck, stable, Johannes Berg

Brian Norris <briannorris@chromium.org> writes:

> On Mon, Jul 29, 2019 at 9:01 AM Takashi Iwai <tiwai@suse.de> wrote:
>> This isn't seen in linux-next yet.
>
> Apparently not.
>
>> Still pending review?
>
> I guess? Probably mostly pending maintainer attention.

Correct, I was offline for few days.

> Also, Johannes already had noticed (and privately messaged me): this
> patch took a while to show up on the linux-wireless Patchwork
> instance. So the first review (from Guenter Roeck) and my extra reply
> noting the -stable regression didn't make it to Patchwork:
>
> https://patchwork.kernel.org/patch/11057585/
>
>> In anyway,
>>   Reviewed-by: Takashi Iwai <tiwai@suse.de>
>
> Thanks. Hopefully Kalle can pick it up.

I expect to apply this today.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5.3] mwifiex: fix 802.11n/WPA detection
  2019-07-24 19:46 [PATCH 5.3] mwifiex: fix 802.11n/WPA detection Brian Norris
                   ` (2 preceding siblings ...)
  2019-07-29 16:01 ` Takashi Iwai
@ 2019-07-30 15:02 ` Kalle Valo
  3 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-07-30 15:02 UTC (permalink / raw)
  To: Brian Norris
  Cc: Ganapathi Bhat, Nishant Sarmukadam, Amitkumar Karwar, Xinming Hu,
	linux-kernel, linux-wireless, Takashi Iwai, Guenter Roeck,
	Brian Norris, stable

Brian Norris <briannorris@chromium.org> wrote:

> 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: <stable@vger.kernel.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Patch applied to wireless-drivers.git, thanks.

df612421fe25 mwifiex: fix 802.11n/WPA detection

-- 
https://patchwork.kernel.org/patch/11057585/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-30 15:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 19:46 [PATCH 5.3] mwifiex: fix 802.11n/WPA detection Brian Norris
2019-07-24 19:50 ` Brian Norris
2019-07-24 19:58 ` Guenter Roeck
2019-07-29 16:01 ` Takashi Iwai
2019-07-29 19:45   ` Brian Norris
2019-07-30  8:08     ` Kalle Valo
2019-07-30 15:02 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).