netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NET]: Messed multicast lists after dev_mc_sync/unsync
@ 2008-02-19 14:56 Patrick McHardy
  2008-02-19 22:17 ` David Miller
  2008-02-27 11:37 ` Johannes Berg
  0 siblings, 2 replies; 9+ messages in thread
From: Patrick McHardy @ 2008-02-19 14:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1058 bytes --]

commit 6548b91f39381b2c5f02f99c14734546354bff89
Author: Jorge Boncompte [DTI2] <jorge@dti2.net>
Date:   Mon Feb 18 16:02:01 2008 +0100

    [NET]: Messed multicast lists after dev_mc_sync/unsync
    
    Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 from you
    introduced a new field "da_synced" to struct dev_addr_list that is
    not properly initialized to 0. So when any of the current users (8021q,
    macvlan, mac80211) calls dev_mc_sync/unsync they mess the address
    list for both devices.
    
    The attached patch fixed it for me and avoid future problems.
    
    Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/core/dev.c b/net/core/dev.c
index 6cfc123..9516105 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2900,7 +2900,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count,
 		}
 	}
 
-	da = kmalloc(sizeof(*da), GFP_ATOMIC);
+	da = kzalloc(sizeof(*da), GFP_ATOMIC);
 	if (da == NULL)
 		return -ENOMEM;
 	memcpy(da->da_addr, addr, alen);

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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-19 14:56 [NET]: Messed multicast lists after dev_mc_sync/unsync Patrick McHardy
@ 2008-02-19 22:17 ` David Miller
  2008-02-27  7:38   ` Pekka Savola
  2008-02-27 11:37 ` Johannes Berg
  1 sibling, 1 reply; 9+ messages in thread
From: David Miller @ 2008-02-19 22:17 UTC (permalink / raw)
  To: kaber; +Cc: netdev

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 19 Feb 2008 15:56:59 +0100

>     [NET]: Messed multicast lists after dev_mc_sync/unsync
>     
>     Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 from you
>     introduced a new field "da_synced" to struct dev_addr_list that is
>     not properly initialized to 0. So when any of the current users (8021q,
>     macvlan, mac80211) calls dev_mc_sync/unsync they mess the address
>     list for both devices.
>     
>     The attached patch fixed it for me and avoid future problems.
>     
>     Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
>     Signed-off-by: Patrick McHardy <kaber@trash.net>

I've added the headline description of the referenced commit
to this commit message, and will queue this up to -stable.

Thanks!

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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-19 22:17 ` David Miller
@ 2008-02-27  7:38   ` Pekka Savola
  2008-02-27  7:52     ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Pekka Savola @ 2008-02-27  7:38 UTC (permalink / raw)
  To: David Miller; +Cc: kaber, netdev

This seems to have missed 2.6.24.3 (also 2.6.23.17), hopefully the 
next stable will have it.

On Tue, 19 Feb 2008, David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Tue, 19 Feb 2008 15:56:59 +0100
>
>>     [NET]: Messed multicast lists after dev_mc_sync/unsync
>>
>>     Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 from you
>>     introduced a new field "da_synced" to struct dev_addr_list that is
>>     not properly initialized to 0. So when any of the current users (8021q,
>>     macvlan, mac80211) calls dev_mc_sync/unsync they mess the address
>>     list for both devices.
>>
>>     The attached patch fixed it for me and avoid future problems.
>>
>>     Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
>>     Signed-off-by: Patrick McHardy <kaber@trash.net>
>
> I've added the headline description of the referenced commit
> to this commit message, and will queue this up to -stable.
>
> Thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings

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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-27  7:38   ` Pekka Savola
@ 2008-02-27  7:52     ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2008-02-27  7:52 UTC (permalink / raw)
  To: pekkas; +Cc: kaber, netdev

From: Pekka Savola <pekkas@netcore.fi>
Date: Wed, 27 Feb 2008 09:38:34 +0200 (EET)

> This seems to have missed 2.6.24.3 (also 2.6.23.17), hopefully the 
> next stable will have it.

I will make sure it does.

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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-19 14:56 [NET]: Messed multicast lists after dev_mc_sync/unsync Patrick McHardy
  2008-02-19 22:17 ` David Miller
@ 2008-02-27 11:37 ` Johannes Berg
  2008-02-27 11:46   ` Patrick McHardy
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2008-02-27 11:37 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David S. Miller, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

    
>     Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 from you
>     introduced a new field "da_synced" to struct dev_addr_list that is
>     not properly initialized to 0. So when any of the current users (8021q,
>     macvlan, mac80211) calls dev_mc_sync/unsync they mess the address
>     list for both devices.
>  
> -	da = kmalloc(sizeof(*da), GFP_ATOMIC);
> +	da = kzalloc(sizeof(*da), GFP_ATOMIC);

Could this be the reason for us seeing "multicast address leakage"
warnings?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-27 11:37 ` Johannes Berg
@ 2008-02-27 11:46   ` Patrick McHardy
  2008-02-27 12:34     ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick McHardy @ 2008-02-27 11:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: David S. Miller, Linux Netdev List

Johannes Berg wrote:
>     
>   
>>     Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 from you
>>     introduced a new field "da_synced" to struct dev_addr_list that is
>>     not properly initialized to 0. So when any of the current users (8021q,
>>     macvlan, mac80211) calls dev_mc_sync/unsync they mess the address
>>     list for both devices.
>>  
>> -	da = kmalloc(sizeof(*da), GFP_ATOMIC);
>> +	da = kzalloc(sizeof(*da), GFP_ATOMIC);
>>     
>
> Could this be the reason for us seeing "multicast address leakage"
> warnings?


I don't think so, the users field was already initialized properly
before. Is wireless using dev_unicast_sync or dev_mc_sync?


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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-27 11:46   ` Patrick McHardy
@ 2008-02-27 12:34     ` Johannes Berg
  2008-02-27 12:42       ` Patrick McHardy
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2008-02-27 12:34 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David S. Miller, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]


> > Could this be the reason for us seeing "multicast address leakage"
> > warnings?
> 
> 
> I don't think so, the users field was already initialized properly
> before. Is wireless using dev_unicast_sync or dev_mc_sync?

dev_mc_sync(), we sync all multicast addresses of all interfaces to the
master netdev to have a single consistent list. There used to be a
custom implementation of that but I replaced it.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-27 12:34     ` Johannes Berg
@ 2008-02-27 12:42       ` Patrick McHardy
  2008-02-27 12:46         ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick McHardy @ 2008-02-27 12:42 UTC (permalink / raw)
  To: Johannes Berg; +Cc: David S. Miller, Linux Netdev List

Johannes Berg wrote:
>>> Could this be the reason for us seeing "multicast address leakage"
>>> warnings?
>>
>> I don't think so, the users field was already initialized properly
>> before. Is wireless using dev_unicast_sync or dev_mc_sync?
> 
> dev_mc_sync(), we sync all multicast addresses of all interfaces to the
> master netdev to have a single consistent list. There used to be a
> custom implementation of that but I replaced it.


I can't see how this bug could be responsible, assuming da_synced
intially contained a non-zero value it might forget to sync an
address, but still try to delete it when unsyncing. __dev_addr_delete
will simply do nothing in this case. But I guess the patch is still
worth trying.


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

* Re: [NET]: Messed multicast lists after dev_mc_sync/unsync
  2008-02-27 12:42       ` Patrick McHardy
@ 2008-02-27 12:46         ` Johannes Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-02-27 12:46 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David S. Miller, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]


> >> I don't think so, the users field was already initialized properly
> >> before. Is wireless using dev_unicast_sync or dev_mc_sync?
> > 
> > dev_mc_sync(), we sync all multicast addresses of all interfaces to the
> > master netdev to have a single consistent list. There used to be a
> > custom implementation of that but I replaced it.
> 
> 
> I can't see how this bug could be responsible, assuming da_synced
> intially contained a non-zero value it might forget to sync an
> address, but still try to delete it when unsyncing. __dev_addr_delete
> will simply do nothing in this case. But I guess the patch is still
> worth trying.

I don't know how it would cause it either, but seeing that I can't even
reliably reproduce the problem at least that seems like uninitialised
memory could cause it. I guess I'll see if I the problem ever turns up
again after this patch goes in...

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2008-02-27 12:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-19 14:56 [NET]: Messed multicast lists after dev_mc_sync/unsync Patrick McHardy
2008-02-19 22:17 ` David Miller
2008-02-27  7:38   ` Pekka Savola
2008-02-27  7:52     ` David Miller
2008-02-27 11:37 ` Johannes Berg
2008-02-27 11:46   ` Patrick McHardy
2008-02-27 12:34     ` Johannes Berg
2008-02-27 12:42       ` Patrick McHardy
2008-02-27 12:46         ` Johannes Berg

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).