From owner-freebsd-pf@freebsd.org Wed Nov 2 08:09:36 2016 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 2F6BFC2A1F2 for ; Wed, 2 Nov 2016 08:09:36 +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 12EFE1326 for ; Wed, 2 Nov 2016 08:09:36 +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 uA289ZnZ060015 for ; Wed, 2 Nov 2016 08:09:35 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 209475] pf didn't check if enough free RAM for net.pf.states_hashsize Date: Wed, 02 Nov 2016 08:09:35 +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: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: fnoyanisi@yahoo.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created 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: Wed, 02 Nov 2016 08:09:36 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209475 fehmi noyan isi changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170810|0 |1 is obsolete| | --- Comment #7 from fehmi noyan isi --- Created attachment 176410 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D176410&action= =3Dedit The latest patch with console and logging facility outputs Hi there,=20 I setup another VM running FreeBSD 12.0-CURRENT and updated the previous pa= tch to reflect Olivier's suggestion with regards to logging. I used printf(9) to print an error message similar to this pf: Invalid states hash table size : 2147483648. Using the default value 32= 768. Not mentioned in the original bug report, but value of f_srchashsize also n= eeds to be verified against the available memory as setting net.pf.source_nodes_hashsize tunable to a value larger than malloc(9) can allocate causes the system to crash. The snippet below was captured with script(1) utility from a FreeBSD 12.0-CURRENT system patched with attached diff file (note that console outp= ut is not captured, only tty) VM3 ---------------------------------------------------------- Script started on Wed Nov 2 20:07:09 2016 root@vm3:~ # uname -a FreeBSD vm3 12.0-CURRENT FreeBSD 12.0-CURRENT #2: Tue Nov 1 20:27:46 NZDT = 2016 root@vm3:/usr/obj/usr/src/sys/GENERIC amd64 root@vm3:~ # cat /boot/loader.conf net.pf.states_hashsize=3D"2147483648" root@vm3:~ # sysctl hw.realmem hw.realmem: 536805376 root@vm3:~ # kldstat Id Refs Address Size Name 1 3 0xffffffff80200000 1fdc408 kernel 2 1 0xffffffff82419000 2ac85 vboxguest.ko root@vm3:~ # service pf onestart Enabling pf. root@vm3:~ # kldstat Id Refs Address Size Name 1 5 0xffffffff80200000 1fdc408 kernel 2 1 0xffffffff82419000 2ac85 vboxguest.ko 3 1 0xffffffff82444000 351a7 pf.ko root@vm3:~ # dmesg | grep pf pf: Invalid states hash table size : 2147483648. Using the default value 32= 768. pf: Invalid source node hash table size : 0. Using the default value 8192. root@vm3:~ # exit exit Script done on Wed Nov 2 20:08:23 2016 ---------------------------------------------------------- --=20 You are receiving this mail because: You are the assignee for the bug.=