Page MenuHomeFreeBSD

Make ipf sysctl mpsafe

Authored by cy on Feb 25 2020, 8:56 PM.



With the pending retirement of GIANT, this patch will make ipfilter's sysctl's mpsafe.

Test Plan

Currently running on my infrastructure.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline


I assume ipf doesn't run other parts under Giant so does this imply that we've actually had missing locking here all along?

No, because the sysctl handler was running under Giant implicitly (as it wasn't marked as MPSAFE).

This revision is now accepted and ready to land.Feb 25 2020, 9:05 PM

@kaktus yes the handler was under Giant but I meant what did that actually accomplish? But, I didn't look at what the sysctl handler was actually doing.

That it'll not be run more than one at a time (from userspace).

The handler was under "assumed" GIANT. IPF itself uses two other locking mechanisms, common to NetBSD and Solaris (Illumos). I intend to replace them with one of the more modern locks. Given they're called by macros the job won't be as daunting as expected.