HomeFreeBSD

net80211: correct length check in ieee80211_ies_expand()

Description

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

(cherry picked from commit 09dd08f167812a5fdb516fc98f14dbb43221432f)
(cherry picked from commit 32c2c00e3f90d3a01a03ebdf7131c7e300da034c)

Approved by: so
Security: FreeBSD-SA-22:02.wifi

Details

Provenance
bzAuthored on Oct 6 2021, 6:09 PM
markjCommitted on Mar 15 2022, 5:45 PM
Parents
rG6eb932a96913: net80211: proper ssid length check in setmlme_assoc_adhoc()
Branches
Unknown
Tags
Unknown