public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: fix address check in rtnl_fdb_del
@ 2013-04-23 20:39 Vlad Yasevich
  2013-04-23 20:47 ` Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Vlad Yasevich @ 2013-04-23 20:39 UTC (permalink / raw)
  To: netdev; +Cc: dlstevens, Vlad Yasevich

Commit 6681712d67eef14c4ce793561c3231659153a320
	vxlan: generalize forwarding tables

relaxed the address checks in rtnl_fdb_del() to use is_zero_ether_addr().
This allows users to add multicast addresses using the fdb API.  However,
the check in rtnl_fdb_del() still uses a more strict
is_valid_ether_addr() which rejects multicast addresses.  Thus it
is possible to add an fdb that can not be later removed.
Relax the check in rtnl_fdb_del() as well.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 18af08a..2c54cc1 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2192,7 +2192,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
 	}
 
 	addr = nla_data(tb[NDA_LLADDR]);
-	if (!is_valid_ether_addr(addr)) {
+	if (!is_zero_ether_addr(addr)) {
 		pr_info("PF_BRIDGE: RTM_DELNEIGH with invalid ether address\n");
 		return -EINVAL;
 	}
-- 
1.8.1.4

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

* Re: [PATCH net-next] net: fix address check in rtnl_fdb_del
  2013-04-23 20:39 [PATCH net-next] net: fix address check in rtnl_fdb_del Vlad Yasevich
@ 2013-04-23 20:47 ` Ben Hutchings
  2013-04-23 21:04   ` Vlad Yasevich
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2013-04-23 20:47 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: netdev, dlstevens

On Tue, 2013-04-23 at 16:39 -0400, Vlad Yasevich wrote:
> Commit 6681712d67eef14c4ce793561c3231659153a320
> 	vxlan: generalize forwarding tables
> 
> relaxed the address checks in rtnl_fdb_del() to use is_zero_ether_addr().
> This allows users to add multicast addresses using the fdb API.  However,
> the check in rtnl_fdb_del() still uses a more strict
> is_valid_ether_addr() which rejects multicast addresses.  Thus it
> is possible to add an fdb that can not be later removed.
> Relax the check in rtnl_fdb_del() as well.
> 
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
> ---
>  net/core/rtnetlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 18af08a..2c54cc1 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -2192,7 +2192,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
>  	}
>  
>  	addr = nla_data(tb[NDA_LLADDR]);
> -	if (!is_valid_ether_addr(addr)) {
> +	if (!is_zero_ether_addr(addr)) {

This is the opposite of what you want.

Ben.

>  		pr_info("PF_BRIDGE: RTM_DELNEIGH with invalid ether address\n");
>  		return -EINVAL;
>  	}

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: [PATCH net-next] net: fix address check in rtnl_fdb_del
  2013-04-23 20:47 ` Ben Hutchings
@ 2013-04-23 21:04   ` Vlad Yasevich
  2013-04-23 22:29     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Vlad Yasevich @ 2013-04-23 21:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, dlstevens

On 04/23/2013 04:47 PM, Ben Hutchings wrote:
> On Tue, 2013-04-23 at 16:39 -0400, Vlad Yasevich wrote:
>> Commit 6681712d67eef14c4ce793561c3231659153a320
>> 	vxlan: generalize forwarding tables
>>
>> relaxed the address checks in rtnl_fdb_del() to use is_zero_ether_addr().
>> This allows users to add multicast addresses using the fdb API.  However,
>> the check in rtnl_fdb_del() still uses a more strict
>> is_valid_ether_addr() which rejects multicast addresses.  Thus it
>> is possible to add an fdb that can not be later removed.
>> Relax the check in rtnl_fdb_del() as well.
>>
>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>> ---
>>   net/core/rtnetlink.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
>> index 18af08a..2c54cc1 100644
>> --- a/net/core/rtnetlink.c
>> +++ b/net/core/rtnetlink.c
>> @@ -2192,7 +2192,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
>>   	}
>>
>>   	addr = nla_data(tb[NDA_LLADDR]);
>> -	if (!is_valid_ether_addr(addr)) {
>> +	if (!is_zero_ether_addr(addr)) {
>
> This is the opposite of what you want.

of course you are right....  totally forgot the '!'...

Thanks
-vlad
>
> Ben.
>
>>   		pr_info("PF_BRIDGE: RTM_DELNEIGH with invalid ether address\n");
>>   		return -EINVAL;
>>   	}
>

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

* Re: [PATCH net-next] net: fix address check in rtnl_fdb_del
  2013-04-23 21:04   ` Vlad Yasevich
@ 2013-04-23 22:29     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-04-23 22:29 UTC (permalink / raw)
  To: vyasevic; +Cc: bhutchings, netdev, dlstevens

From: Vlad Yasevich <vyasevic@redhat.com>
Date: Tue, 23 Apr 2013 17:04:46 -0400

> On 04/23/2013 04:47 PM, Ben Hutchings wrote:
>> On Tue, 2013-04-23 at 16:39 -0400, Vlad Yasevich wrote:
>>> @@ -2192,7 +2192,7 @@ static int rtnl_fdb_del(struct sk_buff *skb,
>>> struct nlmsghdr *nlh)
>>>   	}
>>>
>>>   	addr = nla_data(tb[NDA_LLADDR]);
>>> -	if (!is_valid_ether_addr(addr)) {
>>> +	if (!is_zero_ether_addr(addr)) {
>>
>> This is the opposite of what you want.
> 
> of course you are right....  totally forgot the '!'...

Please test your patches.

If this patch is so unimportant that you don't feel inclined to test
it, it's probably not important enough for me to apply either.

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

end of thread, other threads:[~2013-04-23 22:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-23 20:39 [PATCH net-next] net: fix address check in rtnl_fdb_del Vlad Yasevich
2013-04-23 20:47 ` Ben Hutchings
2013-04-23 21:04   ` Vlad Yasevich
2013-04-23 22:29     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox