netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: netdev@vger.kernel.org, banyeer@yahoo.com
Subject: Re: bridge: Fix IGMP3 report parsing
Date: Wed, 07 Apr 2010 20:52:48 -0700 (PDT)	[thread overview]
Message-ID: <20100407.205248.113724360.davem@davemloft.net> (raw)
In-Reply-To: <20100408012634.GC18649@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 8 Apr 2010 09:26:34 +0800

> Hi:
> 
> bridge: Fix IGMP3 report parsing
> 
> The IGMP3 report parsing is looking at the wrong address for
> group records.  This patch fixes it.
> 
> Reported-by: Banyeer <banyeer@yahoo.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

I think you're adding as many bugs as you are fixing here :-)

> @@ -719,11 +719,11 @@ static int br_multicast_igmp3_report(struct net_bridge *br,
>  	len = sizeof(*ih);
>  
>  	for (i = 0; i < num; i++) {
> +		grec = (void *)(skb->data + len);
>  		len += sizeof(*grec);
>  		if (!pskb_may_pull(skb, len))
>  			return -EINVAL;
>  
> -		grec = (void *)(skb->data + len);
>  		group = grec->grec_mca;
>  		type = grec->grec_type;
>  

If pskb_may_pull() actually does anything non-trivial,
skb->data will change and you'll be referring to freed
up memory.

That's probably why you had the grec assignment where
you originally had it in the first place :-)

  reply	other threads:[~2010-04-08  3:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08  1:26 bridge: Fix IGMP3 report parsing Herbert Xu
2010-04-08  3:52 ` David Miller [this message]
2010-04-08  4:07   ` Herbert Xu
2010-04-08  4:21     ` David Miller

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=20100407.205248.113724360.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=banyeer@yahoo.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).