On 06-07-17 10:41, Dan Carpenter wrote: > The lower level networking code ensures that "len" is between 25 and > NL80211_ATTR_FRAME (2304). We subtract DOT11_MGMT_HDR_LEN (24) from > "len" so thats's max of 2280. But the action_frame->data[] buffer is > only BRCMF_FIL_ACTION_FRAME_SIZE (1800) bytes long so this memcpy() can > overflow. > > memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN], > le16_to_cpu(action_frame->len)); Thanks, Dan Looks fine to me so ... Acked-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx> > Reported-by: "freenerguo(郭大兴)" <freenerguo@xxxxxxxxxxx> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > index dcde596c9eb9..bdae7b44a5ec 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > @@ -4934,6 +4934,11 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, > cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, > GFP_KERNEL); > } else if (ieee80211_is_action(mgmt->frame_control)) { > + if (len > sizeof(action_frame->data) + DOT11_MGMT_HDR_LEN) { > + err = -EINVAL; > + goto exit; > + } > + > af_params = kzalloc(sizeof(*af_params), GFP_KERNEL); > if (af_params == NULL) { > brcmf_err("unable to allocate frame\n"); > > > You're receiving this message because you're a member of the brcm80211-dev-list group. > > This message and any attachments may contain confidential information from Cypress or its subsidiaries. If it has been received in error, please advise the sender and immediately delete this message. >