Page MenuHomeFreeBSD

Make ipf sysctl mpsafe
ClosedPublic

Authored by cy on Feb 25 2020, 8:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 8:23 AM
Unknown Object (File)
Thu, May 2, 8:07 AM
Unknown Object (File)
Thu, May 2, 8:07 AM
Unknown Object (File)
Thu, May 2, 1:10 AM
Unknown Object (File)
Sat, Apr 20, 3:37 AM
Unknown Object (File)
Dec 20 2023, 8:06 AM
Unknown Object (File)
Dec 13 2023, 7:16 PM
Unknown Object (File)
Oct 29 2023, 1:45 AM
Subscribers

Details

Summary

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

Test Plan

Currently running on my infrastructure.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

LGTM

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.