Patchwork [3.5.y.z,extended,stable] Patch "mwifiex: fix potential out-of-boundary access to ibss rate" has been added to staging queue

login
register
mail settings
Submitter Luis Henriques
Date March 21, 2013, 12:51 p.m.
Message ID <1363870313-19476-1-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/229662/
State New
Headers show

Comments

Luis Henriques - March 21, 2013, 12:51 p.m.
This is a note to let you know that I have just added a patch titled

    mwifiex: fix potential out-of-boundary access to ibss rate

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From d8e8ef78b68b250a28a609efcd61b7767b90a8cf Mon Sep 17 00:00:00 2001
From: Bing Zhao <bzhao@marvell.com>
Date: Thu, 7 Mar 2013 20:00:16 -0800
Subject: [PATCH] mwifiex: fix potential out-of-boundary access to ibss rate
 table

commit 5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c upstream.

smatch found this error:

CHECK   drivers/net/wireless/mwifiex/join.c
  drivers/net/wireless/mwifiex/join.c:1121
  mwifiex_cmd_802_11_ad_hoc_join()
  error: testing array offset 'i' after use.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/mwifiex/join.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--
1.8.1.2

Patch

diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index d6b4fb0..97bb759 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1093,10 +1093,9 @@  mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
 		adhoc_join->bss_descriptor.bssid,
 		adhoc_join->bss_descriptor.ssid);

-	for (i = 0; bss_desc->supported_rates[i] &&
-			i < MWIFIEX_SUPPORTED_RATES;
-			i++)
-			;
+	for (i = 0; i < MWIFIEX_SUPPORTED_RATES &&
+		    bss_desc->supported_rates[i]; i++)
+		;
 	rates_size = i;

 	/* Copy Data Rates from the Rates recorded in scan response */