Commit bc6cffd1 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

pppoe: Unshare skb before anything else

We need to unshare the skb first as otherwise pskb_may_pull may
write to a shared skb which could be bad.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 392fdb0e
...@@ -432,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb, ...@@ -432,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
if (dev_net(dev) != &init_net) if (dev_net(dev) != &init_net)
goto abort; goto abort;
if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto abort;
if (!(skb = skb_share_check(skb, GFP_ATOMIC))) if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out; goto out;
if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto abort;
ph = pppoe_hdr(skb); ph = pppoe_hdr(skb);
if (ph->code != PADT_CODE) if (ph->code != PADT_CODE)
goto abort; goto abort;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment