linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: "Dan Carpenter" <dan.carpenter@oracle.com>,
	"freenerguo(郭大兴)" <freenerguo@tencent.com>
Cc: "Franky Lin" <franky.lin@broadcom.com>,
	"Hante Meuleman" <hante.meuleman@broadcom.com>,
	"Chi-Hsien Lin" <Chi-Hsien.Lin@cypress.com>,
	"Wright Feng" <Wright.Feng@cypress.com>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"Pieter-Paul Giesberts" <pieter-paul.giesberts@broadcom.com>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"brcm80211-dev-list.pdl@broadcom.com"
	<brcm80211-dev-list.pdl@broadcom.com>,
	brcm80211-dev-list <brcm80211-dev-list@cypress.com>,
	"security@kernel.org" <security@kernel.org>
Subject: Re: [PATCH] brcmfmac: buffer overflow in brcmf_cfg80211_mgmt_tx()
Date: Thu, 6 Jul 2017 19:11:06 +0200	[thread overview]
Message-ID: <d2c78377-5608-b6c3-07d8-17dfc56a5c7e@broadcom.com> (raw)
In-Reply-To: <88f27bfd328f4ccdb0d6b7ff7e710819@MWHPR06MB3230.namprd06.prod.outlook.com>

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@broadcom.com>
> Reported-by: "freenerguo(郭大兴)" <freenerguo@tencent.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> 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.
> 

       reply	other threads:[~2017-07-06 17:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <88f27bfd328f4ccdb0d6b7ff7e710819@MWHPR06MB3230.namprd06.prod.outlook.com>
2017-07-06 17:11 ` Arend van Spriel [this message]
2017-07-06 22:32   ` [PATCH] brcmfmac: buffer overflow in brcmf_cfg80211_mgmt_tx() Linus Torvalds
2017-07-07  8:28     ` Arend van Spriel
2017-07-07  8:41       ` Kalle Valo
2017-07-07  8:40     ` Kalle Valo
2017-07-07  8:49       ` Dan Carpenter
2017-07-07  9:19         ` Arend van Spriel
2017-07-07  8:46     ` Dan Carpenter
2017-07-07  9:24       ` Arend van Spriel
2017-07-07 10:19         ` Dan Carpenter
2017-07-07 11:19           ` Arend van Spriel
2017-07-07 11:21         ` Arend van Spriel
     [not found] <76EE61108481FC4BBFFF404FA986AA6719B8EA26@EXMBX-TJ001.tencent.com>
2017-07-06  8:41 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2c78377-5608-b6c3-07d8-17dfc56a5c7e@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=Chi-Hsien.Lin@cypress.com \
    --cc=Wright.Feng@cypress.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211-dev-list@cypress.com \
    --cc=dan.carpenter@oracle.com \
    --cc=franky.lin@broadcom.com \
    --cc=freenerguo@tencent.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pieter-paul.giesberts@broadcom.com \
    --cc=rafal@milecki.pl \
    --cc=security@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).