Page MenuHomeFreeBSD

pf: Register the netlink family only while the vnets are set up
ClosedPublic

Authored by rcm on Mon, Oct 12, 3:40 PM.
Tags
None
Referenced Files
F176280871: D60651.id189612.diff
Sat, Oct 17, 3:21 PM
F176280855: D60651.id189772.diff
Sat, Oct 17, 3:21 PM
Unknown Object (File)
Fri, Oct 16, 12:03 PM
Unknown Object (File)
Thu, Oct 15, 12:19 AM
Unknown Object (File)
Wed, Oct 14, 11:08 PM
Unknown Object (File)
Wed, Oct 14, 12:42 PM
Unknown Object (File)
Wed, Oct 14, 3:31 AM
Unknown Object (File)
Wed, Oct 14, 2:44 AM

Details

Summary

pf_modevent() registers the generic netlink family at MOD_LOAD, before
vnet_pf_init() has set up the state hashes and locks the handlers use,
and pf_unload() unregisters it after vnet_pf_uninit() has torn them
down. Sending PFNL_CMD_GETSTATES while pf loads or unloads panics in
pf_handle_getstates() on a NULL or freed V_pf_idhash.

Register the family from a SYSINIT ordered after vnet_pf_init(), and
unregister it from the matching SYSUNINIT, before vnet_pf_uninit().

Fixes: 2cef62886dc7 ("pf: convert state retrieval to netlink")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable