All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mac80211] mac80211: fix SSID copy on IBSS JOIN
@ 2012-10-26 16:54 Antonio Quartulli
  2012-10-26 20:51 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-10-26 16:54 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John W. Linville, linux-wireless, Antonio Quartulli

The 'ssid' field of the cfg80211_ibss_params is a u8 pointer and therefore the
length is likely to be less than IEEE80211_MAX_SSID_LEN most of the times.

This patch fixes the ssid copy in ieee80211_ibss_join() by preventing it from
reading beyond the string.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/mac80211/ibss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5f3620f..bf87c70 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1108,7 +1108,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);
-- 
1.7.12.4


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

* Re: [PATCH mac80211] mac80211: fix SSID copy on IBSS JOIN
  2012-10-26 16:54 [PATCH mac80211] mac80211: fix SSID copy on IBSS JOIN Antonio Quartulli
@ 2012-10-26 20:51 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-10-26 20:51 UTC (permalink / raw)
  To: Antonio Quartulli; +Cc: John W. Linville, linux-wireless

On Fri, 2012-10-26 at 18:54 +0200, Antonio Quartulli wrote:
> The 'ssid' field of the cfg80211_ibss_params is a u8 pointer and therefore the
> length is likely to be less than IEEE80211_MAX_SSID_LEN most of the times.
> 
> This patch fixes the ssid copy in ieee80211_ibss_join() by preventing it from
> reading beyond the string.
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>

Applied, I also added Cc stable since this goes back a long time.

johannes


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

end of thread, other threads:[~2012-10-26 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-26 16:54 [PATCH mac80211] mac80211: fix SSID copy on IBSS JOIN Antonio Quartulli
2012-10-26 20:51 ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.