From owner-freebsd-bugs@freebsd.org Wed Mar 7 02:57:02 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A142F47675 for ; Wed, 7 Mar 2018 02:57:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0AC778DF0 for ; Wed, 7 Mar 2018 02:57:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 0841A10BA2 for ; Wed, 7 Mar 2018 02:57:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w272v0Mf068298 for ; Wed, 7 Mar 2018 02:57:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w272v0dF068297 for freebsd-bugs@FreeBSD.org; Wed, 7 Mar 2018 02:57: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: freebsd-bugs@FreeBSD.org Subject: [Bug 226411] PF does not properly keep state with GRE in IPSec Date: Wed, 07 Mar 2018 02:57:01 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: eric@edombroski.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-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.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2018 02:57:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D226411 Bug ID: 226411 Summary: PF does not properly keep state with GRE in IPSec Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: eric@edombroski.com It appears pf keeps incorrect state for packets routed via a GRE tunnel sec= ured via IPSec. GRE tunnel works correctly without IPSec, but with IPSec (trans= port mode) enabled between the hosts and pf enabled, traffic does not flow as expected. Traffic between hosts (not going over GRE tunnel) with IPSec app= ears to work as expected. ICMP echo requests / replies and TCP SYN packets make it through, even if=20 rules are put in place to prevent the traffic. TCP replies are NOT let through, even if rules are put in place to allow the traffic.=20=20 When showing states with pfctl, it seems that the states are both in one direction when using IPSec, as opposed to in opposite directions without IP= Sec. CORRECT (GRE tunnel w/o IPSEC): > pfctl -ss | grep 10.6.0.10 | grep 10.1.0.1 gre0 icmp 10.6.0.10:63271 <- 10.1.0.1:63271 0:0 vmx1 icmp 10.1.0.1:63271 -> 10.6.0.10:63271 0:0 BAD (GRE tunnel w/ IPSEC): > pfctl -ss | grep 10.6.0.10 | grep 10.1.0.1 vmx1 icmp 10.1.0.1:588 -> 10.6.0.10:588 0:0 gre0 icmp 10.6.0.10:588 -> 10.1.0.1:588 0:0 Config: host1 10.10.10.1 external interface, 10.6.0.1 internal interface host2 10.10.10.2 host1 (freebsd router) ifconfig gre0 tunnel: inet 10.10.10.1 -> 10.10.10.2 inet 10.1.0.1 --> 10.1.0.2 netmask 0xfffffffc host2 (freebsd client) ifconfig gre0 tunnel: inet 10.10.10.2 -> 10.10.10.1 inet 10.1.0.2 --> 10.1.0.1 netmask 0xfffffffc host2: route add -net 10.6.0.0/23 10.1.0.1 Originally came across this in downstream pfSense based on 11.1-RELEASE-p6,= but I've reproduced this 12-CURRENT snapshot r330034. --=20 You are receiving this mail because: You are the assignee for the bug.=