From owner-freebsd-bugs@freebsd.org Mon Mar 30 16:03:39 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 3BD842A6E8B for ; Mon, 30 Mar 2020 16:03:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 48rchB252Hz48MJ for ; Mon, 30 Mar 2020 16:03:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 38D2C2A6E83; Mon, 30 Mar 2020 16:03:33 +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 364282A6E82 for ; Mon, 30 Mar 2020 16:03:33 +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) server-signature RSA-PSS (4096 bits) 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 48rch41FDnz48KG for ; Mon, 30 Mar 2020 16:03:32 +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) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76DFA1EF19 for ; Mon, 30 Mar 2020 16:02:44 +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 02UG2iE1033186 for ; Mon, 30 Mar 2020 16:02:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 02UG2iJN033185 for bugs@FreeBSD.org; Mon, 30 Mar 2020 16:02:44 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 245190] Ipfilter, statefull packet filtering - IPV6 UDP packets issue Date: Mon, 30 Mar 2020 16:02:44 +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: 11.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: vladi.kamburov@gmail.com 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.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2020 16:03:39 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245190 Bug ID: 245190 Summary: Ipfilter, statefull packet filtering - IPV6 UDP packets issue Product: Base System Version: 11.3-RELEASE Hardware: i386 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: vladi.kamburov@gmail.com Hi,=20=20=20 I found a strange behavior with IPv6 udp packets, when ipfilter rules are configured for statefull packet filtering. OS - FreeBSD 11.3-Release, IP Filter: v5.1.2. FreeBSD is configured as a router/firewall with dual stack IPv4/IPv6(tunnel-broker)=20 This is a simple rule set, that can produce the issue: ipfstat -in6 1 pass in quick on lo0 all 2 block in log quick from any to any with short 3 block in log quick from any to any with ipopts 4 skip 1 in inet6 proto tcp from any to any flags S/FSRA 5 block in quick proto tcp from any to any 6 block in log quick on re0 inet6 from any to any head 1000 7 block in log quick on gif0 inet6 from any to any head 2000 8 block in log quick inet6 from any to any 9 pass in quick inet6 from fe80::/10 to fe80::/10 group 1000 10 pass in quick inet6 from ff00::/8 to ff00::/8 group 1000 11 pass in quick inet6 from fe80::/10 to ff00::/8 group 1000 12 pass in quick inet6 from 2001:xxxx::/64 to any keep state group 1000 13 pass in quick inet6 from fe80::/10 to 2001:xxxx::1/128 keep state group = 1000 14 block in log quick inet6 from pool/rfc5156-4291 to any group 2000 15 pass in quick inet6 proto ipv6-icmp from any to 2001:xxxx::2/128 icmp-ty= pe echo keep state group 2000 16 pass in quick inet6 proto ipv6-icmp from any to 2001:xxxx:/64 keep state group 2000 17 pass in quick inet6 proto udp from any to 2001:xxxx::/64 port 33433 >< 3= 3601 keep state group 2000 ipfstat -onh6 1 pass out quick on lo0 all 2 pass out quick on re0 inet6 from any to any keep state 3 pass out quick on gif0 inet6 from any to any keep state 4 block out log quick all When setup the above rules, ipmon start showing events for blocked egress u= dp packets on gif0 (ntp, dns packets...)=20 When I do traceroute6 from firewall host the packet was also blocked. Becau= se somehow those packets doesn=E2=80=99t match the rule:=20 pass out quick on gif0 inet6 from any to any keep state and match=20 block out log quick all Ipmon generate event: ipmon[1153]: 12:24:31.328486 gif0 @0:6 b 2001:xxxx::2,47011 -> 2a00:1450:4017:80a::2003,33435 PR udp len 40 60 OUT bad Note: The event " @0:6 b " because there are IPv4 rules that also counts. ipfstat -t6 do not show any udp state=20 When I set pass out quick on gif0 inet6 from any to any the IPv6 udp packets match the rule, but this leads the need to add an ingr= ess rule(e.g. stateless filtering) This behavior happen only when IPv6 udp packets are sourced from the router/firewall. When IPv6 udp packets are sourced from the inside IPv6 network(behind the router/firewall) udp packets match keep state rule and forwarded between interfaces correctly. Also states can be seen with ipfstat -t6 Can anyone reproduce or confirm this issue or bug. --=20 You are receiving this mail because: You are the assignee for the bug.=