[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bb374f51-f0c7-d315-6a82-11400e71625a@broadcom.com>
Date:   Mon, 24 Apr 2017 13:10:50 +0200
From:   Arend van Spriel <arend.vanspriel@...adcom.com>
To:     James Hughes <james.hughes@...pberrypi.org>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        Kalle Valo <kvalo@...eaurora.org>,
        linux-wireless@...r.kernel.org,
        brcm80211-dev-list.pdl@...adcom.com, netdev@...r.kernel.org
Subject: Re: [PATCH] brcmfmac: Ensure pointer correctly set if skb data
 location changes
On 4/24/2017 12:52 PM, James Hughes wrote:
> The incoming skb header may be resized if header space is
> insufficient, which might change the data adddress in the skb.
> Ensure that a cached pointer to that data is correctly set by
> moving assignment to after any possible changes.
Thanks, James
Minor nit below...
You may add my acknowledgement:
Acked-by: Arend van Spriel <arend.vanspriel@...adcom.com>
> Signed-off-by: James Hughes <james.hughes@...pberrypi.org>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
[...]
> @@ -229,6 +229,8 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
>   		}
>   	}
>   
> +	eh = (struct ethhdr *)(skb->data);
> +
Please move after the length validation below.
Regards,
Arend
>   	/* validate length for ether packet */
>   	if (skb->len < sizeof(*eh)) {
>   		ret = -EINVAL;
> 
Powered by blists - more mailing lists