summaryrefslogtreecommitdiff
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@kernel.org>2021-12-31 03:36:34 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-11 15:58:49 +0300
commite30dead00aaa5a575b10117dad8edc126efc1873 (patch)
tree4a80e299f466a5c32d7c8c171515a694be14ba51 /net/ipv6/route.c
parent44c90b4e6bcbb10f4066b91e8da9c58d4609768c (diff)
downloadlinux-e30dead00aaa5a575b10117dad8edc126efc1873.tar.xz
ipv6: Check attribute length for RTA_GATEWAY when deleting multipath route
commit 1ff15a710a862db1101b97810af14aedc835a86a upstream. Make sure RTA_GATEWAY for IPv6 multipath route has enough bytes to hold an IPv6 address. Fixes: 6b9ea5a64ed5 ("ipv6: fix multipath route replace error recovery") Signed-off-by: David Ahern <dsahern@kernel.org> Cc: Roopa Prabhu <roopa@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9df115e89f6c..1bc81be07ccd 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -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;
}
}