Skip to content

Commit 1ff15a7

Browse files
dsaherndavem330
authored andcommitted
ipv6: Check attribute length for RTA_GATEWAY when deleting multipath route
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]>
1 parent 4619bcf commit 1ff15a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/ipv6/route.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5453,7 +5453,11 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,
54535453

54545454
nla = nla_find(attrs, attrlen, RTA_GATEWAY);
54555455
if (nla) {
5456-
nla_memcpy(&r_cfg.fc_gateway, nla, 16);
5456+
err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla,
5457+
extack);
5458+
if (err)
5459+
return err;
5460+
54575461
r_cfg.fc_flags |= RTF_GATEWAY;
54585462
}
54595463
}

0 commit comments

Comments
 (0)