From: Herbert Xu Date: Tue, 10 Jun 2008 21:08:25 +0000 (-0700) Subject: pppoe: Unshare skb before anything else X-Git-Tag: v2.6.26-rc6~13^2~3 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc6cffd177f9266af38dba96a2cea06c1e7ff932;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index d89ccfd6650..bafb69b6f7c 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;