Skip to content

Commit badecb0

Browse files
Antonio Quartullijmberg-intel
authored andcommitted
mac80211: fix SSID copy on IBSS JOIN
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. Cc: [email protected] Signed-off-by: Antonio Quartulli <[email protected]> [rewrapped commit message, small rewording] Signed-off-by: Johannes Berg <[email protected]>
1 parent f7fbf70 commit badecb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mac80211/ibss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
11081108
sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
11091109
sdata->u.ibss.ibss_join_req = jiffies;
11101110

1111-
memcpy(sdata->u.ibss.ssid, params->ssid, IEEE80211_MAX_SSID_LEN);
1111+
memcpy(sdata->u.ibss.ssid, params->ssid, params->ssid_len);
11121112
sdata->u.ibss.ssid_len = params->ssid_len;
11131113

11141114
mutex_unlock(&sdata->u.ibss.mtx);

0 commit comments

Comments
 (0)