]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: brcmfmac: validate bsscfg indices in IF events
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Mon, 23 Mar 2026 07:45:51 +0000 (15:45 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Apr 2026 10:34:20 +0000 (12:34 +0200)
brcmf_fweh_handle_if_event() validates the firmware-provided interface
index before it touches drvr->iflist[], but it still uses the raw
bsscfgidx field as an array index without a matching range check.

Reject IF events whose bsscfg index does not fit in drvr->iflist[]
before indexing the interface array.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20260323074551.93530-1-pengpeng@iscas.ac.cn
[add missing wifi prefix]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c

index 984886481f4e05b46876d19e702f4c4ffd50cfc7..1cff4ba769430348e23be7dcf5a4993572a1da7c 100644 (file)
@@ -153,6 +153,11 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
                bphy_err(drvr, "invalid interface index: %u\n", ifevent->ifidx);
                return;
        }
+       if (ifevent->bsscfgidx >= BRCMF_MAX_IFS) {
+               bphy_err(drvr, "invalid bsscfg index: %u\n",
+                        ifevent->bsscfgidx);
+               return;
+       }
 
        ifp = drvr->iflist[ifevent->bsscfgidx];