Skip to content

Commit 023c1f2

Browse files
Veerendranath Jakkamjmberg-intel
authored andcommitted
wifi: cfg80211: fix out-of-bounds access during multi-link element defragmentation
Currently during the multi-link element defragmentation process, the multi-link element length added to the total IEs length when calculating the length of remaining IEs after the multi-link element in cfg80211_defrag_mle(). This could lead to out-of-bounds access if the multi-link element or its corresponding fragment elements are the last elements in the IEs buffer. To address this issue, correctly calculate the remaining IEs length by deducting the multi-link element end offset from total IEs end offset. Cc: [email protected] Fixes: 2481b5d ("wifi: cfg80211: handle BSS data contained in ML probe responses") Signed-off-by: Veerendranath Jakkam <[email protected]> Link: https://patch.msgid.link/20250424-fix_mle_defragmentation_oob_access-v1-1-84412a1743fa@quicinc.com Signed-off-by: Johannes Berg <[email protected]>
1 parent 30763f1 commit 023c1f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/wireless/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ cfg80211_defrag_mle(const struct element *mle, const u8 *ie, size_t ielen,
26812681
/* Required length for first defragmentation */
26822682
buf_len = mle->datalen - 1;
26832683
for_each_element(elem, mle->data + mle->datalen,
2684-
ielen - sizeof(*mle) + mle->datalen) {
2684+
ie + ielen - mle->data - mle->datalen) {
26852685
if (elem->id != WLAN_EID_FRAGMENT)
26862686
break;
26872687

0 commit comments

Comments
 (0)