aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopa Prabhu <[email protected]>2020-05-31 05:17:20 +0000
committerDavid S. Miller <[email protected]>2020-06-01 19:06:26 +0000
commit03eaeda7806dcafb221a66939fcec9748619d16a (patch)
treea2318303f02cae39f8692b4e4c0ab266bb6be0c9
parentswitch cmsghdr_from_user_compat_to_kern() to copy_from_user() (diff)
downloadkernel-03eaeda7806dcafb221a66939fcec9748619d16a.tar.gz
kernel-03eaeda7806dcafb221a66939fcec9748619d16a.zip
vxlan: fix dereference of nexthop group in nexthop update path
fix dereference of nexthop group in fdb nexthop group update validation path. Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Reported-by: Ido Schimmel <[email protected]> Suggested-by: Ido Schimmel <[email protected]> Signed-off-by: Roopa Prabhu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/vxlan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index d5906b41cdae..5bb448ae6c9c 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -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) {