aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2021-10-06 18:41:37 +0000
committerMark Johnston <markj@FreeBSD.org>2022-03-15 18:16:01 +0000
commit46f1fb82372e38a2e32bf47522cfe1f67de144b2 (patch)
treeb488cc146bde1d1c79f3b5f3380f470758d58b83
parent8794413823ab1be9170e08d38dc8c68b853455a7 (diff)
downloadsrc-46f1fb82372e38a2e32bf47522cfe1f67de144b2.tar.gz
src-46f1fb82372e38a2e32bf47522cfe1f67de144b2.zip
net80211: proper ssid length check in setmlme_assoc_adhoc()
A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user supplied buffer. The ssid is a fixed size array for the ioctl and the argument to setmlme_assoc_adhoc(). In addition to an ssid_len check of 0 also error in case the ssid_len is larger than the size of the ssid array to prevent problems. PR: 254737 Reported by: Tommaso (cutesmilee.research protonmail.com) (cherry picked from commit 526370fb85db4b659cff4625eb2f379acaa4a1a8) (cherry picked from commit 0525ece3554edce14fa68a7fb61078ae2110c44b) (cherry picked from commit ab5678c6c0d0b28feafdb2fd397866d6088f37d8) (cherry picked from commit f4d0e8787a09f4cdfb856924aaca97f1c78b65b1) Approved by: so Security: FreeBSD-SA-22:02.wifi
-rw-r--r--sys/net80211/ieee80211_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 7e3a986e79f3..5ffa09f844c1 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -1591,7 +1591,7 @@ setmlme_assoc_adhoc(struct ieee80211vap *vap,
("expected opmode IBSS or AHDEMO not %s",
ieee80211_opmode_name[vap->iv_opmode]));
- if (ssid_len == 0)
+ if (ssid_len == 0 || ssid_len > IEEE80211_NWID_LEN)
return EINVAL;
sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP,