linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()
Date: Mon, 5 Sep 2016 12:37:44 +0200	[thread overview]
Message-ID: <36836ecb-e44c-086c-bc84-6dcf16a9981a@broadcom.com> (raw)
In-Reply-To: <1473068749-22487-1-git-send-email-arend.vanspriel@broadcom.com>

On 5-9-2016 11:45, Arend van Spriel wrote:
> User-space can choose to omit NL80211_ATTR_SSID and only provide raw
> IE TLV data. When doing so it can provide SSID IE with length exceeding
> the allowed size. The driver further processes this IE copying it
> into a local variable without checking the length. Hence stack can be
> corrupted and used as exploit.

This patch is intended for wireless-drivers repository, ie. for v4.8.

Regards,
Arend

> Cc: stable@vger.kernel.org # v4.7
> Reported-by: Daxing Guo <freener.gdx@gmail.com>
> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
> Reviewed-by: Franky Lin <franky.lin@broadcom.com>
> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index 5db56a7..b8aec5e5 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -4527,7 +4527,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
>  				(u8 *)&settings->beacon.head[ie_offset],
>  				settings->beacon.head_len - ie_offset,
>  				WLAN_EID_SSID);
> -		if (!ssid_ie)
> +		if (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN)
>  			return -EINVAL;
>  
>  		memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len);
> 

  reply	other threads:[~2016-09-05 10:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05  9:45 [PATCH] brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap() Arend van Spriel
2016-09-05 10:37 ` Arend Van Spriel [this message]
2016-09-07 13:44 ` Kalle Valo
  -- strict thread matches above, loose matches on Subject: below --
2016-09-15 11:41 [PATCH] " Arend van Spriel
2016-09-15 11:43 Arend van Spriel

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=36836ecb-e44c-086c-bc84-6dcf16a9981a@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.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).