From owner-freebsd-bugs@freebsd.org Thu Jul 2 15:06:00 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7E45358ACC for ; Thu, 2 Jul 2020 15:06:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49yLyJ50rYz3gsf for ; Thu, 2 Jul 2020 15:06:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id AA0B6358D89; Thu, 2 Jul 2020 15:06:00 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9D0D3588C5 for ; Thu, 2 Jul 2020 15:06:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49yLyJ45DXz3xZm for ; Thu, 2 Jul 2020 15:06:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58DEC1C57E for ; Thu, 2 Jul 2020 15:06:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 062F60K3004484 for ; Thu, 2 Jul 2020 15:06:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 062F60NL004480 for bugs@FreeBSD.org; Thu, 2 Jul 2020 15:06:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 247718] FreeBSD incorrectly drops IPv6 packets looping back to the same p2p interface Date: Thu, 02 Jul 2020 15:06:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: aranea@aixah.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2020 15:06:00 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247718 Bug ID: 247718 Summary: FreeBSD incorrectly drops IPv6 packets looping back to the same p2p interface Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: aranea@aixah.de FreeBSD's IPv6 stack explicitly drops packets which were received on an IFF_POINTOPOINT interface and are then looped back to the same interface [1= ]. This piece of code originated in the KAME project, and was controversial ev= en when it was enabled there by default back in 2001 [2]. Notably, there is no equivalent logic in FreeBSD's IPv4 stack -- it also generates ICMP Redirect messages under these circumstances, but doesn't drop any packets. While this logic may arguably make sense for true point-to-point links, not= all interfaces with the IFF_POINTOPOINT flag are such links. In particular, tun interfaces are always marked with this flag, even though the userland application behind a tun interface might well be forwarding packets to mult= iple peers. One example for an application that uses tun interfaces to present a point-to-multipoint/NBMA link rather than a point-to-point link is wireguard-go, the userland implementation of the wireguard protocol [3]. In this case, the aforementioned logic causes packet drops in a perfectly valid network topol= ogy, as reported in [4]. Therefore, I would suggest removing the entire "if ((nh->nh_ifp->if_flags & IFF_POINTOPOINT) !=3D 0) { ... }" block that drops these packets. Even in t= he case of true point-to-point links, its only function is to avoid transient loopi= ng of packets sent my misconfigured applications or attackers. This is a well-kno= wn problem [5] that can be easily avoided by proper route configuration, rather than by hardcoded kernel logic to drop packets. [1] https://svnweb.freebsd.org/base/head/sys/netinet6/ip6_forward.c?view=3Dmark= up&pathrev=3D362338#l265 [2] lengthy ML thread archived at https://www.ietf.org/mail-archive/text/ipngwg/2001-04.mail and -05, subject "nonexisting destination on p2p link" [3] https://www.wireguard.com/ [4] https://forums.freebsd.org/threads/wireguard-peers-cant-reach-each-other-on= -ipv6.75991/ [5] https://tools.ietf.org/html/rfc6164#section-5.1 --=20 You are receiving this mail because: You are the assignee for the bug.=