Page MenuHomeFreeBSD

pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes
AcceptedPublic

Authored by glebius on Fri, Mar 27, 7:21 PM.
Tags
None
Referenced Files
F150606020: D56113.diff
Thu, Apr 2, 6:29 PM
F150575951: D56113.diff
Thu, Apr 2, 12:42 PM
Unknown Object (File)
Wed, Apr 1, 6:08 PM
Unknown Object (File)
Wed, Apr 1, 2:07 PM
Unknown Object (File)
Wed, Apr 1, 4:48 AM
Unknown Object (File)
Tue, Mar 31, 9:38 AM
Unknown Object (File)
Tue, Mar 31, 8:33 AM
Unknown Object (File)
Mon, Mar 30, 2:03 PM

Details

Reviewers
kp
Group Reviewers
network

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71774
Build 68657: arc lint + arc unit

Event Timeline

glebius added inline comments.
sys/netpfil/pf/pf.c
1434

.head = HASH_HEAD_LIST is not needed, but I decided to be more explicit.

glebius retitled this revision from pf: use hashalloc(9) for key and id hashes to pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes.Sat, Mar 28, 6:59 PM
  • Extend to src-nodes and udp-endpoints hashes.
sys/netpfil/pf/pf.c
1435–1436

Initialization of .type and .head to the default values. May be omitted.

I'm seeing panics with this patch ("panic: lock "pf_keyhash" 0xfffffe00e8dffff8 already initialized").
I believe the problem is that hashalloc() allocates unzero'd memory, and which leads to incorrect assertions on the lock, if LO_INITIALIZED happens to be set in lo_flags.

In D56113#1284599, @kp wrote:

I'm seeing panics with this patch ("panic: lock "pf_keyhash" 0xfffffe00e8dffff8 already initialized").
I believe the problem is that hashalloc() allocates unzero'd memory, and which leads to incorrect assertions on the lock, if LO_INITIALIZED happens to be set in lo_flags.

That's because you have it on top of older version of D55904. In the updated version MTX_NEW is passed. For me this revision passes all pf tests.

Ah, yes, thanks!

This revision is now accepted and ready to land.Mon, Mar 30, 8:03 PM