Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Nov 2016 08:09:35 +0000
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
Message-ID:  <bug-209475-17777-ru5XOfXS7c@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209475-17777@https.bugs.freebsd.org/bugzilla/>
References:  <bug-209475-17777@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209475

fehmi noyan isi <fnoyanisi@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #170810|0                           |1
        is obsolete|                            |

--- Comment #7 from fehmi noyan isi <fnoyanisi@yahoo.com> ---
Created attachment 176410
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=176410&action=edit
The latest patch with console and logging facility outputs

Hi there, 

I setup another VM running FreeBSD 12.0-CURRENT and updated the previous patch
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 32768.

Not mentioned in the original bug report, but value of f_srchashsize also needs
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 output
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="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 32768.
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
----------------------------------------------------------

-- 
You are receiving this mail because:
You are the assignee for the bug.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209475-17777-ru5XOfXS7c>