Message ID | 20221020104954.GA461052@laguna (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Kalle Valo |
Headers | show |
Series | [v2] brcmfmac: Fixes potential buffer overflow in 'brcmf_fweh_event_worker' | expand |
+ Kalle On 10/20/2022 12:49 PM, Dokyung Song wrote: > This patch fixes an intra-object buffer overflow in brcmfmac that occurs > when the device provides a 'bsscfgidx' equal to or greater than the > buffer size. The patch adds a check that leads to a safe failure if that > is the case. Thanks for the updated patch. The subject for all linux-wireless patches should begin with 'wifi:'. Sorry for noticing it not earlier. Maybe Kalle can correct it when applying the patch. Regards, Arend
The working email address this time (I hope). On 10/20/2022 1:29 PM, Arend Van Spriel wrote: > + Kalle > > On 10/20/2022 12:49 PM, Dokyung Song wrote: >> This patch fixes an intra-object buffer overflow in brcmfmac that occurs >> when the device provides a 'bsscfgidx' equal to or greater than the >> buffer size. The patch adds a check that leads to a safe failure if that >> is the case. > > Thanks for the updated patch. The subject for all linux-wireless patches > should begin with 'wifi:'. Sorry for noticing it not earlier. Maybe > Kalle can correct it when applying the patch. > > Regards, > Arend
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c index bc3f4e4edcdf..dac7eb77799b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c @@ -228,6 +228,10 @@ static void brcmf_fweh_event_worker(struct work_struct *work) brcmf_fweh_event_name(event->code), event->code, event->emsg.ifidx, event->emsg.bsscfgidx, event->emsg.addr); + if (event->emsg.bsscfgidx >= BRCMF_MAX_IFS) { + bphy_err(drvr, "invalid bsscfg index: %u\n", event->emsg.bsscfgidx); + goto event_free; + } /* convert event message */ emsg_be = &event->emsg;