All of lore.kernel.org
 help / color / mirror / Atom feed
* bridge: Fix fatal typo in setup of multicast_querier_expired
@ 2012-04-30 10:22 Herbert Xu
  2012-04-30 16:04 ` Stephen Hemminger
  2012-04-30 17:27 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Herbert Xu @ 2012-04-30 10:22 UTC (permalink / raw)
  To: David S. Miller, netdev

Unfortunately it seems that I didn't properly test the case of
an expired external querier in the recent multicast bridge series.

The setup of the timer in that case is completely broken and leads
to a NULL-pointer dereference.  This patch fixes it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 26df642..b320871 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -744,8 +744,7 @@ static void br_multicast_local_router_expired(unsigned long data)
 
 static void br_multicast_querier_expired(unsigned long data)
 {
-	struct net_bridge_port *port = (void *)data;
-	struct net_bridge *br = port->br;
+	struct net_bridge *br = (void *)data;
 
 	spin_lock(&br->multicast_lock);
 	if (!netif_running(br->dev) || br->multicast_disabled)
@@ -1581,7 +1580,7 @@ void br_multicast_init(struct net_bridge *br)
 	setup_timer(&br->multicast_router_timer,
 		    br_multicast_local_router_expired, 0);
 	setup_timer(&br->multicast_querier_timer,
-		    br_multicast_querier_expired, 0);
+		    br_multicast_querier_expired, (unsigned long)br);
 	setup_timer(&br->multicast_query_timer, br_multicast_query_expired,
 		    (unsigned long)br);
 }

Sorry for the screw-up.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: bridge: Fix fatal typo in setup of multicast_querier_expired
  2012-04-30 10:22 bridge: Fix fatal typo in setup of multicast_querier_expired Herbert Xu
@ 2012-04-30 16:04 ` Stephen Hemminger
  2012-04-30 17:27 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2012-04-30 16:04 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, netdev

On Mon, 30 Apr 2012 20:22:56 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> Unfortunately it seems that I didn't properly test the case of
> an expired external querier in the recent multicast bridge series.
> 
> The setup of the timer in that case is completely broken and leads
> to a NULL-pointer dereference.  This patch fixes it.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Acked-by: Stephen Hemminger <shemminger@vyatta.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bridge: Fix fatal typo in setup of multicast_querier_expired
  2012-04-30 10:22 bridge: Fix fatal typo in setup of multicast_querier_expired Herbert Xu
  2012-04-30 16:04 ` Stephen Hemminger
@ 2012-04-30 17:27 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-04-30 17:27 UTC (permalink / raw)
  To: herbert; +Cc: netdev

From: Herbert Xu <herbert@gondor.hengli.com.au>
Date: Mon, 30 Apr 2012 20:22:56 +1000

> Unfortunately it seems that I didn't properly test the case of
> an expired external querier in the recent multicast bridge series.
> 
> The setup of the timer in that case is completely broken and leads
> to a NULL-pointer dereference.  This patch fixes it.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
 ...
> -		    br_multicast_querier_expired, 0);
> +		    br_multicast_querier_expired, (unsigned long)br);
>  	setup_timer(&br->multicast_query_timer, br_multicast_query_expired,
>  		    (unsigned long)br);
>  }
> 
> Sorry for the screw-up.

Please do not put comments after the patch, this made the second hunk
reject when I pulled it out of patchwork.

Anyways, fixed up and applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-30 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 10:22 bridge: Fix fatal typo in setup of multicast_querier_expired Herbert Xu
2012-04-30 16:04 ` Stephen Hemminger
2012-04-30 17:27 ` David Miller

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.