linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Wright Feng <wright.feng@cypress.com>, linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com,
	Arend van Spriel <arend.vanspriel@broadcom.com>,
	Franky Lin <franky.lin@broadcom.com>,
	Hante Meuleman <hante.meuleman@broadcom.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	chi-hsien.lin@cypress.com,
	Raveendran Somu <raveendran.somu@cypress.com>
Subject: Re: [PATCH 1/5] brcmfmac: To fix kernel crash on out of boundary access
Date: Mon, 1 Jun 2020 21:34:50 -0700	[thread overview]
Message-ID: <8fe5fdf5-1b26-a127-3567-321017455a49@gmail.com> (raw)
In-Reply-To: <20200601071953.23252-2-wright.feng@cypress.com>



On 6/1/2020 12:19 AM, Wright Feng wrote:
> From: Raveendran Somu <raveendran.somu@cypress.com>
> 
> To trunkcate the addtional bytes, if extra bytes been received.

typo: truncate. Missing "have been received".

> Current code only have a warning and proceed without handling it.
> But in one of the crash reported by DVT, these causes the
> crash intermittently. So the processing is limit to the skb->len.
> 
> Signed-off-by: Raveendran Somu <raveendran.somu@cypress.com>
> Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
> Signed-off-by: Wright Feng <wright.feng@cypress.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> index 09701262330d..531fe9be4025 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> @@ -1843,6 +1843,9 @@ void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb)
>  
>  	WARN_ON(siglen > skb->len);
>  
> +	if (siglen > skb->len)
> +		siglen = skb->len;

Does it make sense to keep the WARN_ON() one live above then?

> +
>  	if (!siglen)
>  		return;
>  	/* if flow control disabled, skip to packet data and leave */
> 

-- 
Florian

  reply	other threads:[~2020-06-02  4:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  7:19 [PATCH 0/5] brcmfmac: Stability change series Wright Feng
2020-06-01  7:19 ` [PATCH 1/5] brcmfmac: To fix kernel crash on out of boundary access Wright Feng
2020-06-02  4:34   ` Florian Fainelli [this message]
2020-06-03  6:40     ` Wright Feng
2020-06-01  7:19 ` [PATCH 2/5] brcmfmac: fix invliad permanent MAC address in wiphy Wright Feng
2020-06-01  7:19 ` [PATCH 3/5] brcmfmac: keep SDIO watchdog running when console_interval is non-zero Wright Feng
2020-06-01  7:19 ` [PATCH 4/5] brcmfmac: reduce maximum station interface from 2 to 1 in RSDB mode Wright Feng
2020-06-01  7:19 ` [PATCH 5/5] brcmfmac: To fix Bss Info flag definition Bug Wright Feng

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=8fe5fdf5-1b26-a127-3567-321017455a49@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=brcm80211-dev-list@cypress.com \
    --cc=chi-hsien.lin@cypress.com \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=raveendran.somu@cypress.com \
    --cc=wright.feng@cypress.com \
    /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).