Skip to content

Commit

Permalink
ipv6: Check attribute length for RTA_GATEWAY when deleting multipath …
Browse files Browse the repository at this point in the history
…route

commit 1ff15a710a862db1101b97810af14aedc835a86a upstream.

Make sure RTA_GATEWAY for IPv6 multipath route has enough bytes to hold
an IPv6 address.

Fixes: 6b9ea5a ("ipv6: fix multipath route replace error recovery")
Signed-off-by: David Ahern <[email protected]>
Cc: Roopa Prabhu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dsahern authored and gregkh committed Jan 11, 2022
1 parent 44c90b4 commit e30dead
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -4606,7 +4606,11 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,

nla = nla_find(attrs, attrlen, RTA_GATEWAY);
if (nla) {
nla_memcpy(&r_cfg.fc_gateway, nla, 16);
err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla,
extack);
if (err)
return err;

r_cfg.fc_flags |= RTF_GATEWAY;
}
}
Expand Down

0 comments on commit e30dead

Please sign in to comment.