Date: Tue, 15 Mar 2022 18:16:13 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 8794413823ab - releng/12.3 - net80211: correct length check in ieee80211_ies_expand() Message-ID: <202203151816.22FIGD1A075590@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch releng/12.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8794413823ab1be9170e08d38dc8c68b853455a7 commit 8794413823ab1be9170e08d38dc8c68b853455a7 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2021-10-06 18:09:39 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-03-15 18:15:57 +0000 net80211: correct length check in ieee80211_ies_expand() In ieee80211_ies_expand() we are looping over Elements (also known as Information Elements or IEs). The comment suggests that we assume well-formedness of the IEs themselves. Checking the buffer length being least 2 (1 byte Element ID and 1 byte Length fields) rather than just 1 before accessing ie[1] is still good practise and can prevent and out-of-bounds read in case the input is not behaving according to the comment. Reported by: (coypu sdf.org) admbugs: 857 MFC after: 3 days Reviewed by: adrian, markj Differential Revision: https://reviews.freebsd.org/D32340 (cherry picked from commit 09dd08f167812a5fdb516fc98f14dbb43221432f) (cherry picked from commit 8dc4c0a922b7e7a0ee682f4e1426f876692c0828) Approved by: so Security: FreeBSD-SA-22:02.wifi --- sys/net80211/ieee80211_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 9ee5b1b83cde..36dfea039df1 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1134,7 +1134,7 @@ ieee80211_ies_expand(struct ieee80211_ies *ies) ie = ies->data; ielen = ies->len; - while (ielen > 0) { + while (ielen > 1) { switch (ie[0]) { case IEEE80211_ELEMID_VENDOR: if (iswpaoui(ie))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203151816.22FIGD1A075590>