wifi: nl80211: reject oversized EMA RNR element lists
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 wifi: nl80211: reject oversized EMA RNR element lists
From: Yuqi Xu <[email protected]>
nl80211_parse_rnr_elems() stores the parsed element count in a u8-backed cfg80211_rnr_elems::cnt field and uses that count to size the flexible array allocation.
Reject nested NL80211_ATTR_EMA_RNR_ELEMS input once the count reaches 255, before incrementing it again. This keeps the parser aligned with the data structure it fills and matches the existing bound check used by nl80211_parse_mbssid_elems().
--- net/wireless/nl80211.c | 3 +++ 1 file changed, 3 insertions(+)
net/wireless/nl80211.c +3 -0
@@ -6354,6 +6354,9 @@ nl80211_parse_rnr_elems(struct wiphy *wiphy, struct nlattr *attrs,if (ret)return ERR_PTR (ret); +if (num_elems >=255 ) +return ERR_PTR (-EINVAL ); + num_elems++; }
Signature · 1 line
2.54.0
Johannes Berg
maintainerQuoted 6 lines · Ren Wei
From: Yuqi Xu <[email protected]>
nl80211_parse_rnr_elems()stores the parsed element count in a u8-backedcfg80211_rnr_elems::cntfield and uses that count to size the flexible array allocation.
Quoted 6 lines
Reject nested
NL80211_ATTR_EMA_RNR_ELEMSinput once the count reaches 255, before incrementing it again. This keeps the parser aligned with the data structure it fills and matches the existing bound check used bynl80211_parse_mbssid_elems().Fixes dbbb27e183b1568d5a907ace1cd144b0709ea52a ("cfg80211: support RNR for EMA AP")
Please fix.
johannes