]> git.itanic.dy.fi Git - linux-stable/commit
wireguard: socket: ignore v6 endpoints when ipv6 is disabled
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 30 Mar 2022 01:31:27 +0000 (21:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:48 +0000 (14:06 +0200)
commitefde4c0cf7fdbaa27c11740b0ced2e84f73779d8
tree9c195ba2c6725166a1960611734cc5614392a339
parentebcc492f4ba14bae54b898f1016a37b4282558d1
wireguard: socket: ignore v6 endpoints when ipv6 is disabled

commit 77fc73ac89be96ec8f39e8efa53885caa7cb3645 upstream.

The previous commit fixed a memory leak on the send path in the event
that IPv6 is disabled at compile time, but how did a packet even arrive
there to begin with? It turns out we have previously allowed IPv6
endpoints even when IPv6 support is disabled at compile time. This is
awkward and inconsistent. Instead, let's just ignore all things IPv6,
the same way we do other malformed endpoints, in the case where IPv6 is
disabled.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireguard/socket.c