Skip to contentSkip to conversation

net: fix address check in rtnl_fdb_del

PATCH Superseded Vlad Yasevich 3 participants 4 messages Apr 23, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fix address check in rtnl_fdb_del

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.

---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/rtnetlink.c +1 -1
index 18af08a..2c54cc1 100644
@@ -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;
 	}
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 20 lines · 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.

---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/rtnetlink.c +0 -0
index 18af08a..2c54cc1 100644

net/core/rtnetlink.c static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh) · line 2195

Quoted 5 lines
net/core/rtnetlink.c +1 -1
@@ -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.

Quoted 3 lines
net/core/rtnetlink.c +0 -0
 		pr_info("PF_BRIDGE: RTM_DELNEIGH with invalid ether address\n");
 		return -EINVAL;
 	}
Signature · 3 lines
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.
#2 lore raw
Quoted 23 lines · Ben Hutchings
Quoted 22 lines · 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.

---
  net/core/rtnetlink.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
net/core/rtnetlink.c +0 -0
index 18af08a..2c54cc1 100644
@@ -2192,7 +2192,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
  	}
 
Quoted 5 lines

net/core/rtnetlink.c static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh) · line 2195

Quoted 3 lines
net/core/rtnetlink.c +1 -1
  	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

Quoted 7 lines

Ben.

Quoted 3 lines
net/core/rtnetlink.c +0 -0
  		pr_info("PF_BRIDGE: RTM_DELNEIGH with invalid ether address\n");
  		return -EINVAL;
  	}
maintainer
#3 lore raw

From: Vlad Yasevich <[email protected]>
Date: Tue, 23 Apr 2013 17:04:46 -0400

Quoted 6 lines · Ben Hutchings
Quoted 5 lines · Vlad Yasevich
Quoted 4 lines
(quoted diff) +0 -0
@@ -2192,7 +2192,7 @@ static int rtnl_fdb_del(struct sk_buff *skb,
 struct nlmsghdr *nlh)
  	}
 
Quoted 7 lines
Quoted 5 lines

net/core/rtnetlink.c static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh) · line 2195

Quoted 3 lines
net/core/rtnetlink.c +1 -1
  	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.