All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: netdev@vger.kernel.org
Cc: "Linus Lüssing" <linus.luessing@web.de>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: bridge: disable snooping if there is no querier
Date: Tue, 6 Aug 2013 11:18:57 -0400	[thread overview]
Message-ID: <20130806151857.GA25528@redhat.com> (raw)
In-Reply-To: <20130804005227.D17B3660D03@gitolite.kernel.org>

On Sun, Aug 04, 2013 at 12:52:27AM +0000, Linux Kernel wrote:
 > Gitweb:     http://git.kernel.org/linus/;a=commit;h=b00589af3b04736376f24625ab0b394642e89e29
 > Commit:     b00589af3b04736376f24625ab0b394642e89e29
 > Parent:     cf3c4c03060b688cbc389ebc5065ebcce5653e96
 > Author:     Linus Lüssing <linus.luessing@web.de>
 > AuthorDate: Thu Aug 1 01:06:20 2013 +0200
 > Committer:  David S. Miller <davem@davemloft.net>
 > CommitDate: Wed Jul 31 17:40:21 2013 -0700
 > 
 >     bridge: disable snooping if there is no querier
 >     
 >     Signed-off-by: Linus Lüssing <linus.luessing@web.de>
 >     Signed-off-by: David S. Miller <davem@davemloft.net>
 
 > diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
 > @@ -1198,6 +1206,9 @@ static int br_ip6_multicast_query(struct net_bridge *br,
 >  		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
 >  	}
 >  
 > +	br_multicast_query_received(br, port, !ipv6_addr_any(&ip6h->saddr),
 > +				    max_delay);
 > +
 >  	if (!group)
 >  		goto out;

This addition looks suspect. max_delay looks like it could be uninitialised here.

1178         unsigned long max_delay;

...

1189         if (skb->len == sizeof(*mld)) {
1190                 if (!pskb_may_pull(skb, sizeof(*mld))) {
1191                         err = -EINVAL;
1192                         goto out;
1193                 }
1194                 mld = (struct mld_msg *) icmp6_hdr(skb);
1195                 max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
1196                 if (max_delay)
1197                         group = &mld->mld_mca;
1198         } else if (skb->len >= sizeof(*mld2q)) {
1199                 if (!pskb_may_pull(skb, sizeof(*mld2q))) {
1200                         err = -EINVAL;
1201                         goto out;
1202                 }
1203                 mld2q = (struct mld2_query *)icmp6_hdr(skb);
1204                 if (!mld2q->mld2q_nsrcs)
1205                         group = &mld2q->mld2q_mca;
1206                 max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
1207         }
1208 
1209         br_multicast_query_received(br, port, !ipv6_addr_any(&ip6h->saddr),
1210                                     max_delay);

If skb_len matches neither of those conditions, we don't set it.

Explicitly set it to something on entry ? Or is there validation further up the
callchain that skb_len will only ever be one of these two values ?

	Dave

       reply	other threads:[~2013-08-06 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20130804005227.D17B3660D03@gitolite.kernel.org>
2013-08-06 15:18 ` Dave Jones [this message]
2013-08-06 15:47   ` bridge: disable snooping if there is no querier Eric Dumazet

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=20130806151857.GA25528@redhat.com \
    --to=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linus.luessing@web.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.