Skip to contentSkip to conversation

vxlan: fix dereference of nexthop group in nexthop update path

PATCH Applied Roopa Prabhu 2 participants 2 messages May 31, 2020 – Jun 1, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxlan: fix dereference of nexthop group in nexthop update path

From: Roopa Prabhu <[email protected]>

fix dereference of nexthop group in fdb nexthop group update validation path.

Fixes 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries")
---
 drivers/net/vxlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/vxlan.c +2 -2
index 39bc10a..ea7af03 100644
@@ -881,13 +881,13 @@ static int vxlan_fdb_nh_update(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
 			goto err_inval;
 		}
 
-		if (!nh->is_group || !nh->nh_grp->mpath) {
+		nhg = rtnl_dereference(nh->nh_grp);
+		if (!nh->is_group || !nhg->mpath) {
 			NL_SET_ERR_MSG(extack, "Nexthop is not a multipath group");
 			goto err_inval;
 		}
 
 		/* check nexthop group family */
-		nhg = rtnl_dereference(nh->nh_grp);
 		switch (vxlan->default_dst.remote_ip.sa.sa_family) {
 		case AF_INET:
 			if (!nhg->has_v4) {
Signature · 1 line
2.1.4