From: "Linus Lüssing" <linus.luessing@web.de>
To: netdev@vger.kernel.org
Cc: bridge@lists.linux-foundation.org,
"Stephen Hemminger" <stephen@networkplumber.org>,
"David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org, "Jan Stancek" <jstancek@redhat.com>,
"Florian Westphal" <fwestpha@redhat.com>,
"Linus Lüssing" <linus.luessing@web.de>
Subject: [PATCHv2 2/2] bridge: multicast: enable snooping on general queries only
Date: Mon, 10 Mar 2014 22:25:25 +0100 [thread overview]
Message-ID: <1394486725-4992-2-git-send-email-linus.luessing@web.de> (raw)
In-Reply-To: <1394486725-4992-1-git-send-email-linus.luessing@web.de>
Without this check someone could easily create a denial of service
by injecting multicast-specific queries to enable the bridge
snooping part if no real querier issuing periodic general queries
is present on the link which would result in the bridge wrongly
shutting down ports for multicast traffic as the bridge did not learn
about these listeners.
With this patch the snooping code is enabled upon receiving valid,
general queries only.
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
v2: unchanged
net/bridge/br_multicast.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index e56bae4..93067ec 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1127,9 +1127,10 @@ static void br_multicast_query_received(struct net_bridge *br,
struct net_bridge_port *port,
struct bridge_mcast_querier *querier,
int saddr,
+ bool is_general_query,
unsigned long max_delay)
{
- if (saddr)
+ if (saddr && is_general_query)
br_multicast_update_querier_timer(br, querier, max_delay);
else if (timer_pending(&querier->timer))
return;
@@ -1190,7 +1191,7 @@ static int br_ip4_multicast_query(struct net_bridge *br,
}
br_multicast_query_received(br, port, &br->ip4_querier, !!iph->saddr,
- max_delay);
+ !group, max_delay);
if (!group)
goto out;
@@ -1282,7 +1283,8 @@ static int br_ip6_multicast_query(struct net_bridge *br,
}
br_multicast_query_received(br, port, &br->ip6_querier,
- !ipv6_addr_any(&ip6h->saddr), max_delay);
+ !ipv6_addr_any(&ip6h->saddr),
+ is_general_query, max_delay);
if (!group)
goto out;
--
1.7.10.4
next prev parent reply other threads:[~2014-03-10 21:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 21:25 [PATCHv2 1/2] bridge: multicast: add sanity check for general query destination Linus Lüssing
2014-03-10 21:25 ` Linus Lüssing [this message]
2014-03-10 22:56 ` [PATCHv2 2/2] bridge: multicast: enable snooping on general queries only Hannes Frederic Sowa
2014-03-11 1:48 ` Linus Lüssing
2014-03-12 3:23 ` David Miller
2014-03-12 3:23 ` [PATCHv2 1/2] bridge: multicast: add sanity check for general query destination David Miller
2014-03-12 18:34 ` Ben Hutchings
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=1394486725-4992-2-git-send-email-linus.luessing@web.de \
--to=linus.luessing@web.de \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=fwestpha@redhat.com \
--cc=jstancek@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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).