提交 c5608c2c 编写于 作者: D David Ahern 提交者: Zheng Zengkai

ipv6: Check attribute length for RTA_GATEWAY when deleting multipath route

stable inclusion
from stable-v5.10.91
commit 48d5adb08d60116e9d05f01dcdbe698b5d54cdbb
bugzilla: 186187 https://gitee.com/openeuler/kernel/issues/I4SI2C

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=48d5adb08d60116e9d05f01dcdbe698b5d54cdbb

--------------------------------

commit 1ff15a71 upstream.

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

Fixes: 6b9ea5a6 ("ipv6: fix multipath route replace error recovery")
Signed-off-by: NDavid Ahern <dsahern@kernel.org>
Cc: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 fdf74cdd
......@@ -5342,7 +5342,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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册