mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
tcp_metrics: validate source addr length
[ Upstream commit66be40e622
] I don't see anything checking that TCP_METRICS_ATTR_SADDR_IPV4 is at least 4 bytes long, and the policy doesn't have an entry for this attribute at all (neither does it for IPv6 but v6 is manually validated). Reviewed-by: Eric Dumazet <edumazet@google.com> Fixes:3e7013ddf5
("tcp: metrics: Allow selective get/del of tcp-metrics based on src IP") Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d8aef6be52
commit
2a2e79dbe2
@ -614,6 +614,7 @@ static const struct nla_policy tcp_metrics_nl_policy[TCP_METRICS_ATTR_MAX + 1] =
|
||||
[TCP_METRICS_ATTR_ADDR_IPV4] = { .type = NLA_U32, },
|
||||
[TCP_METRICS_ATTR_ADDR_IPV6] = { .type = NLA_BINARY,
|
||||
.len = sizeof(struct in6_addr), },
|
||||
[TCP_METRICS_ATTR_SADDR_IPV4] = { .type = NLA_U32, },
|
||||
/* Following attributes are not received for GET/DEL,
|
||||
* we keep them for reference
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user