summaryrefslogtreecommitdiffstats
path: root/drivers/net/pppoe.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-06-10 23:08:25 +0200
committerDavid S. Miller <davem@davemloft.net>2008-06-10 23:08:25 +0200
commitbc6cffd177f9266af38dba96a2cea06c1e7ff932 (patch)
tree3d18d0ff6a5e72588ab154b65fe3d8649ffbc477 /drivers/net/pppoe.c
parentnet pppoe: Check packet length on all receive paths (diff)
downloadlinux-bc6cffd177f9266af38dba96a2cea06c1e7ff932.tar.xz
linux-bc6cffd177f9266af38dba96a2cea06c1e7ff932.zip
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: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pppoe.c')
-rw-r--r--drivers/net/pppoe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index d89ccfd6650c..bafb69b6f7cb 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -432,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
if (dev_net(dev) != &init_net)
goto abort;
- if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
- goto abort;
-
if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;
+ if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
+ goto abort;
+
ph = pppoe_hdr(skb);
if (ph->code != PADT_CODE)
goto abort;