]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: nl80211: reject oversized EMA RNR lists
authorYuqi Xu <xuyuqiabc@gmail.com>
Fri, 29 May 2026 15:25:37 +0000 (23:25 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 2 Jun 2026 11:25:19 +0000 (13:25 +0200)
commit4cd92957e8f8cc4ebfe8a5d4203c14c592fde6b1
tree95641117925e179a3e8e7231e43f0a1205a064ca
parentf3be0c984ecbcb82b0bec408022c4ef738cb3843
wifi: nl80211: reject oversized EMA RNR lists

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().

Fixes: dbbb27e183b1 ("cfg80211: support RNR for EMA AP")
Cc: stable@kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Assisted-by: Codex:gpt-5.4
Signed-off-by: Yuqi Xu <xuyuqiabc@gmail.com>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Link: https://patch.msgid.link/20260529152542.1412734-1-n05ec@lzu.edu.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c