Page MenuHomeFreeBSD

Remove deprecated jail global permission sysctls, and make jail(2) COMPAT_FREEBSD11
ClosedPublic

Authored by jamie on Mar 22 2018, 3:56 AM.
Referenced Files
Unknown Object (File)
Feb 7 2024, 9:40 PM
Unknown Object (File)
Jan 10 2024, 2:44 AM
Unknown Object (File)
Dec 22 2023, 10:09 PM
Unknown Object (File)
Dec 20 2023, 10:39 PM
Unknown Object (File)
Dec 16 2023, 6:53 PM
Unknown Object (File)
Sep 6 2023, 7:33 AM
Unknown Object (File)
Jul 31 2023, 3:19 AM
Unknown Object (File)
Jun 14 2023, 8:35 AM
Subscribers

Details

Summary

The old jail system had sysctls to set jail permissions for all jails (e.g. security.jail.mount_allowed), which were superseded by per-jail permissions (e.g. allow.mount). These old sysctls remain a constant source of confusion to users, who expect that setting the sysctl will change the behavior of existing jails. That the sysctl value at the time a jail is created may matter is a backward-compatibility hack that does little or nothing to relieve the confusion. So it's time for them to go.

Also, jail(2) has been replaced by jail_set(2) for a number of years now, and it really ought to retire - at least into the COMPAT world.

Test Plan

There are very few bits of core code that actually used either jail(2) or the old sysctls (they're apparent in the non-kernel parts of the diff). Make sure these still work as expected.

The trickier part is to assess the change to other code, notably jail-related ports such as ezjail. It might be the case that some of this software needs to be brought up to the current state of things.

Diff Detail

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

Event Timeline

As suggested by bz@, I've only removed the sysctls #ifdef BURN_BRIDGES.

Once again, this time actually updating the diff...

I'm keeping the sysctls around, though without COMPAT_FREEBSD11 (or with BURN_BRIDGES), they're read-only. This preserves the expected behavior for programs that want to find out what they're allowed to do before attempting it (e.g. rc.d/hostname and rc.d/zfs). But they will no longer be used to set global permissions for jails.

For a GENERIC kernel, i.e. COMPAT_FREEBSD11 and not BURN_BRIDGES, everything still works as before.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 16 2018, 6:31 PM
This revision was automatically updated to reflect the committed changes.