Page MenuHomeFreeBSD

MAC/do: Remove the 'prison0' special cases in the common paths
ClosedPublic

Authored by olce on Nov 15 2024, 5:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 11, 9:54 PM
Unknown Object (File)
Mon, May 11, 9:17 PM
Unknown Object (File)
Mon, May 11, 8:48 PM
Unknown Object (File)
Sat, Apr 18, 11:56 AM
Unknown Object (File)
Apr 15 2026, 12:13 PM
Unknown Object (File)
Apr 10 2026, 6:00 AM
Unknown Object (File)
Apr 7 2026, 1:09 PM
Unknown Object (File)
Apr 6 2026, 7:03 PM

Details

Summary

This revision is part of a series. Click on the Stack tab below to see the context.
This series has also been squeezed into D47633 to provide an overall view.

Commit message:
The rules on 'prison0' are initialized in init(), now using
set_empty_rules().

Until the jail is destroyed, they can never be uninitialized by a call
to osd_jail_del(), since the only chain to call it is
mac_do_prison_set() -> remove_rules() -> osd_jail_del(), and
mac_do_prison_set() (method PR_METHOD_SET) can never be called on
'prison0'. This guarantees that find_rules() always find a valid
'rules' pointer to return.

There's no need to do anything special in destroy() for 'prison0', as
osd_jail_deregister() now takes care of it.

Diff Detail

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

Event Timeline

olce requested review of this revision.Nov 15 2024, 5:07 PM
This revision is now accepted and ready to land.Nov 19 2024, 8:02 AM