From owner-freebsd-pf@freebsd.org Sun Mar 5 12:43:11 2017 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD948CF828F for ; Sun, 5 Mar 2017 12:43:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B77B15F6 for ; Sun, 5 Mar 2017 12:43:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.16.1.189] (s224.GtokyoFL6.vectant.ne.jp [222.228.90.224]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 1BAC01EF5E; Sun, 5 Mar 2017 13:43:07 +0100 (CET) From: "Kristof Provost" To: Ross Cc: freebsd-pf@freebsd.org Subject: Re: sonewconn: pru_attach() failed and kernel panic in PF Date: Sun, 05 Mar 2017 21:42:59 +0900 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6080) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 12:43:11 -0000 On 27 Feb 2017, at 21:08, Ross wrote: > Hello > > One of my machines panics almost every day. It is always like this: > first > there is a number of messages about "sonewconn: pcb > 0xfffff80085478740: > pru_attach() failed" at the same time and then panic. Here's an > example: > > ... many lines of sonewconn ... > Feb 27 13:41:43 core kernel: sonewconn: pcb 0xfffff8008575bcb0: > pru_attach() failed > Feb 27 13:41:43 core kernel: I wonder if you’re running low on memory by any chance. I think I know why you’re crashing, but I suspect your root problem is that you’re running low on memory and that’s why you’re seeing the pru_attach() failures, and eventually running into the pf panic. > Feb 27 13:41:43 core kernel: KDB: stack backtrace: > Feb 27 13:41:43 core kernel: #0 0xffffffff80b312c7 at > kdb_backtrace+0x67 > Feb 27 13:41:43 core kernel: #1 0xffffffff80ae5c92 at vpanic+0x182 > Feb 27 13:41:43 core kernel: #2 0xffffffff80ae5b03 at panic+0x43 > Feb 27 13:41:43 core kernel: #3 0xffffffff80fd6d51 at trap_fatal+0x351 > Feb 27 13:41:43 core kernel: #4 0xffffffff80fd6f43 at > trap_pfault+0x1e3 > Feb 27 13:41:43 core kernel: #5 0xffffffff80fd64ec at trap+0x26c > Feb 27 13:41:43 core kernel: #6 0xffffffff80fb9d61 at calltrap+0x8 > Feb 27 13:41:43 core kernel: #7 0xffffffff80e4185e at > uma_zfree_arg+0x4fe > Feb 27 13:41:43 core kernel: #8 0xffffffff82442165 at > pf_get_translation+0x2c5 There’s only a couple of calls to uma_zfree() in pf_get_translations(). These are: * uma_zfree(V_pf_state_key_z, skp); * uma_zfree(V_pf_state_key_z, *nkp); * uma_zfree(V_pf_state_key_z, *skp); Going by the inconsistent pointer use the first one is rather suspect. Looking a bit deeper, pf_get_translation() is only called from one place, and it always passes stack variables for skp and nkp, so the first call ends up trying to free that, which won’t work too well. That’s a bug (and I’ll fix it), but you’re only running into it because pf_state_key_clone() returned NULL, which will only happen under memory pressure. > What should I do to fix it? > You’ll need to look at your system and figure out who’s running away with all of your memory. Regards, Kristof From owner-freebsd-pf@freebsd.org Sun Mar 5 13:19:10 2017 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B360ACF90C9 for ; Sun, 5 Mar 2017 13:19:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80CEF1689 for ; Sun, 5 Mar 2017 13:19:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.16.1.189] (s224.GtokyoFL6.vectant.ne.jp [222.228.90.224]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 3F9AD1EF85; Sun, 5 Mar 2017 14:19:06 +0100 (CET) From: "Kristof Provost" To: Ross Cc: freebsd-pf@freebsd.org Subject: Re: sonewconn: pru_attach() failed and kernel panic in PF Date: Sun, 05 Mar 2017 22:19:01 +0900 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6080) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 13:19:10 -0000 On 5 Mar 2017, at 21:42, Kristof Provost wrote: > There’s only a couple of calls to uma_zfree() in > pf_get_translations(). > > These are: > * uma_zfree(V_pf_state_key_z, skp); > * uma_zfree(V_pf_state_key_z, *nkp); > * uma_zfree(V_pf_state_key_z, *skp); > > Going by the inconsistent pointer use the first one is rather suspect. > Looking a bit deeper, pf_get_translation() is only called from one > place, > and it always passes stack variables for skp and nkp, so the first > call > ends up trying to free that, which won’t work too well. > > That’s a bug (and I’ll fix it), but you’re only running into it > because > pf_state_key_clone() returned NULL, which will only happen under > memory > pressure. > The fix is done in r314702. Regards, Kristof From owner-freebsd-pf@freebsd.org Sun Mar 5 21:00:59 2017 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42020CFA787 for ; Sun, 5 Mar 2017 21:00:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 20A4D18C9 for ; Sun, 5 Mar 2017 21:00:59 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v25L01Li038950 for ; Sun, 5 Mar 2017 21:00:59 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201703052100.v25L01Li038950@kenobi.freebsd.org> From: bugzilla-noreply@FreeBSD.org To: freebsd-pf@FreeBSD.org Subject: Problem reports for freebsd-pf@FreeBSD.org that need special attention Date: Sun, 05 Mar 2017 21:00:59 +0000 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 21:00:59 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 203735 | Transparent interception of ipv6 with squid and p 1 problems total for which you should take action. From owner-freebsd-pf@freebsd.org Tue Mar 7 01:09:35 2017 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7748DCFACD4 for ; Tue, 7 Mar 2017 01:09:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 443971FDF for ; Tue, 7 Mar 2017 01:09:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.247.88.168] (ec2-54-250-252-97.ap-northeast-1.compute.amazonaws.com [54.250.252.97]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 191941E51F; Tue, 7 Mar 2017 02:09:33 +0100 (CET) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Kristof Provost Mime-Version: 1.0 (1.0) Subject: Re: sonewconn: pru_attach() failed and kernel panic in PF Date: Tue, 7 Mar 2017 10:04:00 +0900 Message-Id: <2EA59710-A019-4654-A85C-BE7A7DF56EB3@FreeBSD.org> References: Cc: freebsd-pf@freebsd.org In-Reply-To: To: Ross X-Mailer: iPhone Mail (14D27) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 01:09:35 -0000 So it turns out I shouldn't commit things when jet lagged.=20 You want r314810 in head. The other one was mistakenly done in stable/11. It= needed to go there sooner or later so I'm just going to leave it.=20 Regards, Kristof > On 5 Mar 2017, at 22:19, Kristof Provost wrote: >=20 >> On 5 Mar 2017, at 21:42, Kristof Provost wrote: >> There=E2=80=99s only a couple of calls to uma_zfree() in pf_get_translati= ons(). >>=20 >> These are: >> * uma_zfree(V_pf_state_key_z, skp); >> * uma_zfree(V_pf_state_key_z, *nkp); >> * uma_zfree(V_pf_state_key_z, *skp); >>=20 >> Going by the inconsistent pointer use the first one is rather suspect. >> Looking a bit deeper, pf_get_translation() is only called from one place,= >> and it always passes stack variables for skp and nkp, so the first call >> ends up trying to free that, which won=E2=80=99t work too well. >>=20 >> That=E2=80=99s a bug (and I=E2=80=99ll fix it), but you=E2=80=99re only r= unning into it because >> pf_state_key_clone() returned NULL, which will only happen under memory >> pressure. >>=20 > The fix is done in r314702. >=20 > Regards, > Kristof From owner-freebsd-pf@freebsd.org Thu Mar 9 02:40:26 2017 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A126D03468 for ; Thu, 9 Mar 2017 02:40:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 79A53326 for ; Thu, 9 Mar 2017 02:40:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v292eOoO063882 for ; Thu, 9 Mar 2017 02:40:26 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 185633] [pf] scrubbing bug in transparent mode bug with bigger than MTU UDP packet Date: Thu, 09 Mar 2017 02:40:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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: kp@freebsd.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: 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-pf@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2017 02:40:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D185633 Kristof Provost changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|In Progress |Closed --=20 You are receiving this mail because: You are the assignee for the bug.=