tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ipfilter causes panic when setting tcp_idle_timeout



On NetBSD 11.1 amd64, I'm setting a couple ipf tunables via rc.conf like
so:
| ipfilter_flags='-T state_size=189997,state_max=133013,state_maxbucket=100,log_size=131072,nat_table_size=32749,hostmap_size=8191,nat_table_max=60000,tcp_idle_timeout=86400'

All the tunables get set correctly upon boot, except for the last one,
tcp_idle_timeout, which ipf -T list | grep tcp_idle_timeout still
reports to be the default (864000, corresponding to 5 days) instead of
86400 (one fewer 0) as set in rc.conf.

(ipf -T list also somehow reports it twice, which seems like an
unrelated issue.)

Furthermore, attempting to then set it manually via
| ipf -D; ipf -T tcp_idle_timeout=86400
then panics the box:

| uvm_fault(0xffffffff81089d00, 0xfffffffffffff000, 1) -> e
| fatal page fault in supervisor mode
| trap type 6 code 0 rip 0xffffffff80970ebf cs 0x8 rflags 0x10202 cr2 0xfffffffffffffff0 ilevel 0 rsp 0xffffbf8154d1fac0
| curlwp 0xffff962681ae3b40 pid 323.323 lowest kstack 0xffffbf8154d1b2c0
| kernel: page fault trap, code=0
| Stopped in pid 323.323 (ipf) at netbsd:mutex_vector_enter+0x82: movq    0(%r12),
| %rax
| db{0}> bt
| mutex_vector_enter() at netbsd:mutex_vector_enter+0x82
| ipf_settimeout_tcp() at netbsd:ipf_settimeout_tcp+0x60
| ipf_settimeout() at netbsd:ipf_settimeout+0x1c
| ipf_ipftune() at netbsd:ipf_ipftune+0x3ef
| ipfioctl() at netbsd:ipfioctl+0x9a
| cdev_ioctl() at netbsd:cdev_ioctl+0x99
| spec_ioctl() at netbsd:spec_ioctl+0x54
| VOP_IOCTL() at netbsd:VOP_IOCTL+0x47
| vn_ioctl() at netbsd:vn_ioctl+0xb1
| sys_ioctl() at netbsd:sys_ioctl+0x56e
| syscall() at netbsd:syscall+0x1fc
| --- syscall (number 54) ---
| netbsd:syscall+0x1fc:
| db{0}> show reg
| ds          1880
| es          d000
| fs          c780
| gs          0
| rdi         ffffbf8007b8e3e8
| rsi         ffffffff80e1eb07    ostype+0x7b283
| rbp         ffffbf8154d1fb20
| rbx         ffff962681ae3b40
| rdx         ffff962681ae3b40
| rcx         ffff962681ae3b40
| rax         0
| r8          ffffffff80e1ed19    ostype+0x7b495
| r9          ffff962681ae3b40
| r10         ffffbf8154d1fee0
| r11         0
| r12         fffffffffffffff0
| r13         0
| r14         fffffffffffffff0
| r15         ffffbf8007b8e3e8
| rip         ffffffff80970ebf    mutex_vector_enter+0x82
| cs          8
| rflags      10202
| rsp         ffffbf8154d1fac0
| ss          10
| netbsd:mutex_vector_enter+0x82: movq    0(%r12),%rax
| db{0}> reboot

Any clue what's going on?

PS: To preempt the inevitable "you should rather use npf"-argument:
this is planned.  Currently i'm running npf privately on a smaller
network and it's still crashing my router every now and then, so,
it can't replace ipfilter in this case just yet.


Home | Main Index | Thread Index | Old Index