Message ID | 20170424114050.24948-1-james.hughes@raspberrypi.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 455a1eb4654c24560eb9dfc634f29cba3d87601e |
Delegated to: | Kalle Valo |
Headers | show |
On 24-4-2017 13:40, 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. Hi Kalle, This one should go on 4.12 queue as well. Thanks, Arend > Signed-off-by: James Hughes <james.hughes@raspberrypi.org> > > Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> > ---
James Hughes <james.hughes@raspberrypi.org> 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. > > Signed-off-by: James Hughes <james.hughes@raspberrypi.org> > > Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Patch applied to wireless-drivers-next.git, thanks. 455a1eb4654c brcmfmac: Ensure pointer correctly set if skb data location changes
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 5eaac13e2317..9b7c19a508ac 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -198,7 +198,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, int ret; struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_pub *drvr = ifp->drvr; - struct ethhdr *eh = (struct ethhdr *)(skb->data); + struct ethhdr *eh; brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); @@ -236,6 +236,8 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, goto done; } + eh = (struct ethhdr *)(skb->data); + if (eh->h_proto == htons(ETH_P_PAE)) atomic_inc(&ifp->pend_8021x_cnt);