summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-10-26 18:54:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-17 13:18:34 -0800
commit0355494503b5922528b72a129de874bbe526f9c7 (patch)
treee36aa9579ed0e371132c9830199b7062aeee2e27
parent3a817522b33cb42171cd36f5fa77fa40f447f351 (diff)
mac80211: fix SSID copy on IBSS JOIN
commit badecb001a310408d3473b1fc2ed5aefd0bc92a9 upstream. The 'ssid' field of the cfg80211_ibss_params is a u8 pointer and its length is likely to be less than IEEE80211_MAX_SSID_LEN most of the time. This patch fixes the ssid copy in ieee80211_ibss_join() by using the SSID length to prevent it from reading beyond the string. Signed-off-by: Antonio Quartulli <ordex@autistici.org> [rewrapped commit message, small rewording] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/mac80211/ibss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5746d62faba1..327aa076c2bb 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1074,7 +1074,7 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
sdata->u.ibss.ibss_join_req = jiffies;
- memcpy(sdata->u.ibss.ssid, params->ssid, IEEE80211_MAX_SSID_LEN);
+ memcpy(sdata->u.ibss.ssid, params->ssid, params->ssid_len);
sdata->u.ibss.ssid_len = params->ssid_len;
mutex_unlock(&sdata->u.ibss.mtx);