android_kernel_samsung_a7y1.../net/ipv6
Eric Dumazet 014fef7982 ipv6: drop incoming packets having a v4mapped source address
[ Upstream commit 6af1799aaf3f1bc8defedddfa00df3192445bbf3 ]

This began with a syzbot report. syzkaller was injecting
IPv6 TCP SYN packets having a v4mapped source address.

After an unsuccessful 4-tuple lookup, TCP creates a request
socket (SYN_RECV) and calls reqsk_queue_hash_req()

reqsk_queue_hash_req() calls sk_ehashfn(sk)

At this point we have AF_INET6 sockets, and the heuristic
used by sk_ehashfn() to either hash the IPv4 or IPv6 addresses
is to use ipv6_addr_v4mapped(&sk->sk_v6_daddr)

For the particular spoofed packet, we end up hashing V4 addresses
which were not initialized by the TCP IPv6 stack, so KMSAN fired
a warning.

I first fixed sk_ehashfn() to test both source and destination addresses,
but then faced various problems, including user-space programs
like packetdrill that had similar assumptions.

Instead of trying to fix the whole ecosystem, it is better
to admit that we have a dual stack behavior, and that we
can not build linux kernels without V4 stack anyway.

The dual stack API automatically forces the traffic to be IPv4
if v4mapped addresses are used at bind() or connect(), so it makes
no sense to allow IPv6 traffic to use the same v4mapped class.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 08:07:05 +02:00
..
netfilter A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
addrconf_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
addrconf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
addrlabel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
af_inet6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ah6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
anycast.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
datagram.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
esp6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exthdrs_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exthdrs_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exthdrs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fib6_rules.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
icmp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ila.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet6_connection_sock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inet6_hashtables.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_checksum.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_fib.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_flowlabel.c ipv6: flowlabel: fl6_sock_lookup() must use atomic_inc_not_zero 2020-04-06 19:03:40 +02:00
ip6_gre.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_icmp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_input.c ipv6: drop incoming packets having a v4mapped source address 2020-04-07 08:07:05 +02:00
ip6_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_offload.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_output.c ipv6: Fix dangling pointer when ipv6 fragment 2020-04-06 15:07:32 +02:00
ip6_tunnel.c ip6_tunnel: Match to ARPHRD_TUNNEL6 for dev type 2020-04-06 15:08:11 +02:00
ip6_udp_tunnel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6_vti.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ip6mr.c ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt 2020-04-06 20:26:00 +02:00
ipcomp6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ipv6_sockglue.c ipv6: fix a potential deadlock in do_ipv6_setsockopt() 2020-04-06 16:43:14 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mcast_snoop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mcast.c ipv6: fix a potential deadlock in do_ipv6_setsockopt() 2020-04-06 16:43:14 +02:00
mip6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ndisc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netfilter.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
output_core.c inet: switch IP ID generator to siphash 2020-04-06 21:32:45 +02:00
ping.c ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()' 2020-04-06 21:35:13 +02:00
proc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
protocol.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raw.c ipv6: Consider sk_bound_dev_if when binding a raw socket to an address 2020-04-06 18:20:37 +02:00
reassembly.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
route.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sit.c vrf: sit mtu should not be updated when vrf netdev is the link 2020-04-06 17:01:39 +02:00
syncookies.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysctl_net_ipv6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tcp_ipv6.c tcp: do not use ipv6 header for ipv4 flow 2020-04-06 12:57:12 +02:00
tcpv6_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tunnel6.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_impl.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_offload.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udplite.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_input.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_mode_beet.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_mode_ro.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_mode_transport.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_mode_tunnel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_output.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_policy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_protocol.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_state.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm6_tunnel.c xfrm6_tunnel: Fix potential panic when unloading xfrm6_tunnel module 2020-04-06 18:14:31 +02:00