Skip to content

Commit a6299da

Browse files
author
Guillaume Nault
committed
tcp_metrics: validate source addr length
JIRA: https://issues.redhat.com/browse/RHEL-52031 Upstream Status: linux.git CVE: CVE-2024-42154 commit 66be40e Author: Jakub Kicinski <kuba@kernel.org> Date: Thu Jun 27 14:25:00 2024 -0700 tcp_metrics: validate source addr length 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: 3e7013d ("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: Guillaume Nault <gnault@redhat.com>
1 parent 60da98e commit a6299da

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/tcp_metrics.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ static const struct nla_policy tcp_metrics_nl_policy[TCP_METRICS_ATTR_MAX + 1] =
601601
[TCP_METRICS_ATTR_ADDR_IPV4] = { .type = NLA_U32, },
602602
[TCP_METRICS_ATTR_ADDR_IPV6] = { .type = NLA_BINARY,
603603
.len = sizeof(struct in6_addr), },
604+
[TCP_METRICS_ATTR_SADDR_IPV4] = { .type = NLA_U32, },
604605
/* Following attributes are not received for GET/DEL,
605606
* we keep them for reference
606607
*/

0 commit comments

Comments
 (0)