[ 3.5.y.z extended stable ] Patch "mwifiex: limit channel number not to overflow memory" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Apr 11 09:09:03 UTC 2013


This is a note to let you know that I have just added a patch titled

    mwifiex: limit channel number not to overflow memory

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 60b33d5826f17bfba74d3f328740e04cc386f1bf Mon Sep 17 00:00:00 2001
From: Stone Piao <piaoyun at marvell.com>
Date: Fri, 29 Mar 2013 19:21:21 -0700
Subject: [PATCH] mwifiex: limit channel number not to overflow memory

commit 901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f upstream.

Limit the channel number in scan request, or the driver scan
config structure memory will be overflowed.

Signed-off-by: Stone Piao <piaoyun at marvell.com>
Signed-off-by: Bing Zhao <bzhao at marvell.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/net/wireless/mwifiex/cfg80211.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 76b5c0f..4506cda 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1368,7 +1368,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
 		}
 	}

-	for (i = 0; i < request->n_channels; i++) {
+	for (i = 0; i < min_t(u32, request->n_channels,
+			      MWIFIEX_USER_SCAN_CHAN_MAX); i++) {
 		chan = request->channels[i];
 		priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
 		priv->user_scan_cfg->chan_list[i].radio_type = chan->band;
--
1.8.1.2





More information about the kernel-team mailing list