diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-07-23 23:53:55 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-28 10:58:17 -0700 |
commit | c7e0c40126de5c8de8d3346728b026d6a94c5021 (patch) | |
tree | 192bc53ee4151f03b9ea8cecc5df41860be7046b | |
parent | 735699169f8f9963652e53776e2338d823d7a0a8 (diff) |
pppoe: Unshare skb before anything else
[ Upstream commit bc6cffd177f9266af38dba96a2cea06c1e7ff932 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/net/pppoe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 18cf1be1cde..6bc58ddcbe1 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->nd_net != &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; |