Page MenuHomeFreeBSD

Make ipf sysctl mpsafe
ClosedPublic

Authored by cy on Feb 25 2020, 8:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 3 2024, 10:49 PM
Unknown Object (File)
Oct 3 2024, 7:00 PM
Unknown Object (File)
Oct 3 2024, 6:37 PM
Unknown Object (File)
Oct 1 2024, 6:17 PM
Unknown Object (File)
Sep 8 2024, 10:41 AM
Unknown Object (File)
Sep 4 2024, 5:45 PM
Unknown Object (File)
Sep 4 2024, 5:59 AM
Unknown Object (File)
Sep 3 2024, 8:16 PM
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.