[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191003.114210.1662126661929949949.davem@davemloft.net>
Date: Thu, 03 Oct 2019 11:42:10 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: edumazet@...gle.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com, fw@...len.de,
hannes@...essinduktion.org, syzkaller@...glegroups.com
Subject: Re: [PATCH net] ipv6: drop incoming packets having a v4mapped
source address
From: Eric Dumazet <edumazet@...gle.com>
Date: Wed, 2 Oct 2019 09:38:55 -0700
> 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@...gle.com>
> Cc: Florian Westphal <fw@...len.de>
> Cc: Hannes Frederic Sowa <hannes@...essinduktion.org>
> Reported-by: syzbot <syzkaller@...glegroups.com>
Applied and queued up for -stable, thanks Eric.
Powered by blists - more mailing lists