Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Bradley Peterson <despite@gmail.com>
Cc: netdev@vger.kernel.org,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Bruce Allan <bruce.w.allan@intel.com>,
	Carolyn Wyborny <carolyn.wyborny@intel.com>,
	Don Skidmore <donald.c.skidmore@intel.com>,
	Greg Rose <gregory.v.rose@intel.com>,
	PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>,
	Alex Duyck <alexander.h.duyck@intel.com>,
	John Ronciak <john.ronciak@intel.com>,
	e1000-devel@lists.sourceforge.net
Subject: Re: BUG in skb_pull with e1000e, PPTP, and L2TP
Date: Tue, 18 Oct 2011 05:51:19 +0200	[thread overview]
Message-ID: <1318909879.2571.43.camel@edumazet-laptop> (raw)
In-Reply-To: <1318904666.2571.33.camel@edumazet-laptop>

Le mardi 18 octobre 2011 à 04:24 +0200, Eric Dumazet a écrit :

> diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
> index eae542a..d0197e3 100644
> --- a/drivers/net/ppp/pptp.c
> +++ b/drivers/net/ppp/pptp.c
> @@ -305,11 +305,16 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb)
>  	}
>  
>  	header = (struct pptp_gre_header *)(skb->data);
> +	headersize  = sizeof(*header);
>  
>  	/* test if acknowledgement present */
>  	if (PPTP_GRE_IS_A(header->ver)) {
> -		__u32 ack = (PPTP_GRE_IS_S(header->flags)) ?
> -				header->ack : header->seq; /* ack in different place if S = 0 */
> +		__u32 ack;
> +
> +		if (!pskb_may_pull(skb, headersize))
> +			goto drop;

Oh well, this is buggy, I need to set header again, I'll send an updated
patch

		header = (struct pptp_gre_header *)(skb->data);

> +		ack = (PPTP_GRE_IS_S(header->flags)) ?
> +			header->ack : header->seq; /* ack in different place if S = 0 */
>  

  reply	other threads:[~2011-10-18  3:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 22:19 BUG in skb_pull with e1000e, PPTP, and L2TP Bradley Peterson
2011-10-17 22:25 ` Stephen Hemminger
2011-10-17 22:30   ` Bradley Peterson
2011-10-18  2:24 ` Eric Dumazet
2011-10-18  3:51   ` Eric Dumazet [this message]
2011-10-18  3:59     ` Eric Dumazet
2011-10-19  7:31       ` David Miller
2011-10-19  7:47         ` Eric Dumazet
2011-10-19  7:51           ` David Miller
2011-10-24 21:59       ` Bradley Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318909879.2571.43.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=carolyn.wyborny@intel.com \
    --cc=despite@gmail.com \
    --cc=donald.c.skidmore@intel.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=gregory.v.rose@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=john.ronciak@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox