Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 2021 00:02:34 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ab5678c6c0d0 - stable/13 - net80211: proper ssid length check in setmlme_assoc_adhoc()
Message-ID:  <202111190002.1AJ02Y1r072403@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=ab5678c6c0d0b28feafdb2fd397866d6088f37d8

commit ab5678c6c0d0b28feafdb2fd397866d6088f37d8
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-10-06 18:41:37 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2021-11-19 00:01:25 +0000

    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)
---
 sys/net80211/ieee80211_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 2fef9ac0084a..419518eb1224 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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111190002.1AJ02Y1r072403>