Skip to content

Commit 2328766

Browse files
Jonathan T. Leightongregkh
authored andcommitted
ipv6: Inhibit IPv4-mapped src address on the wire.
[ Upstream commit ec5e3b0a1d41fbda0cc33a45bc9e54e91d9d12c7 ] This patch adds a check for the problematic case of an IPv4-mapped IPv6 source address and a destination address that is neither an IPv4-mapped IPv6 address nor in6addr_any, and returns an appropriate error. The check in done before returning from looking up the route. Signed-off-by: Jonathan T. Leighton <jtleight@udel.edu> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8faccb2 commit 2328766

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/ipv6/ip6_output.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,9 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
10041004
}
10051005
}
10061006
#endif
1007+
if (ipv6_addr_v4mapped(&fl6->saddr) &&
1008+
!(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr)))
1009+
return -EAFNOSUPPORT;
10071010

10081011
return 0;
10091012

0 commit comments

Comments
 (0)