- User Since
- Aug 3 2014, 10:29 PM (304 w, 6 d)
Fri, May 29
I'll try the jail_set approach.
Considering jail_set(2) can also attach with the JAIL_ATTACH flag, it would be handy to put these new flags in the same space, with a JAIL_ATTACH_MASK including them. Then the attaching done by jail_set can also do the right thing if it chooses.
Thu, May 14
Wed, May 13
Might it also be useful to include something similar on the stop side, run after taking down the IP addresses? I can't think of a use offhand, unless one wants to leave absolutely no trace of jails, and remove everything that was added in exec.prepare.
It would make sense for this to be two separate commits - one for the reordering of IP_*.
May 7 2020
There's a "right thing" to do on SIGINT, though it's not immediately obvious what that is. In the jail creation process, it would make sense to clean up a partially created jail, probably in conjunction with letting the jailed processes handle their own SIGINT. But that's not quite the same as just ignoring it, because there are other cases:
May 1 2020
If jail_attach(2) doesn't leave a process sufficiently jailed to the point that it can be used for jailbreak, that's a bug in jail_attach that should be fixed.
Apr 24 2020
Apr 23 2020
It may be a better user interface if "-j" automatically did the right thing - limit output to the specified jail for traditional jails, and attach to vnet jails. So after the jail_getid(), a jail_get() or jail_getv() to fetch the jail's vnet parameter. Then the jail_attach() can happen if the vnet is JAIL_SYS_NEW.
Apr 14 2020
Apr 6 2020
Sep 5 2019
Aside from a few trailing whitespaces, this all looks good to me.
Jun 18 2019
May 23 2019
Tested with ps and jexec, passing jail name and jid, and with numerically and non-numerically named jails. All's good :-).
Nov 27 2018
New jails are now created with the unprivileged_proc_debug bit inherited from the parent unless otherwise specified.
Huh - so I can. I didn't know of (or even suspect) such a possibility.
Sorry for a post-acceptance note, but on trying it out I noticed that jails are created by default with allow.nounprivileged_proc_debug. That's an easy fix - the bit needs to be added to PW_DEFAULT_ALLOW in kern_jail.h. I'm apparently unable to change the diff in this revision, so instead of creating a new revision I'll just mention that's what I'll be committing.
Nov 24 2018
priv_check_cred() in kern_priv.c isn't the right place to make the check, but prison_priv_check() in kern_jail.c. PRIV_DEBUG_UNPRIV is already in that function's list, in the part that lets jails do things, and it needs to be moved to the bottom part of the function where you'll see a number of other cases where a certain privilege checks a certain pr_allow bit.
OK, if the jail needs to have that bit set before anything is run, then yes it needs to be a parameter.
Nov 23 2018
Since this bit is under the full control of the prison itself, does it belong in pr_allow? On the plus side, that lets the system create a jail with this turned on, but that can be just as easily done in the jail's sysctl.conf. It's something of a departure from the idea of this being something the jail is or isn't allowed to do. If you forgo the ability to set it as a jail parameter, then the bit can go into pr_flags and you won't have to bother noting which PR_ALLOW bits are allowed to be set .
Nov 10 2018
It's allow.mount.nofusefs. It should (currently) work once the kld is loaded, but the new strcmp will need to be added to make it work before it's loaded.
It works with allow.mount.fusefs, but not with allow.mount.nofusefs (which will still try to kldload "fusefs"). Comparing the fs name to both "fusefs" and "nofusefs" should be all that's needed.
Oct 20 2018
Oct 18 2018
Oct 17 2018
Oct 6 2018
Aug 20 2018
Aug 16 2018
Aug 15 2018
Aug 14 2018
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.
OK, looks good with one last-minute nit: spaces in the jailp.h line where a tab should be
Aug 12 2018
Yes, this is a need that has gone unanswered for a while now.
Jul 30 2018
One more thing to do: jail(8) should mention the flag. There's a section about module-specific flags where I think it would fit better than the main allow.* section.
Jul 20 2018
It's good to see that jail-enabling a filesystem is indeed easier now than it used to be!
Jul 19 2018
Jul 6 2018
Jul 5 2018
I've added D16146, which makes a new allow.* bit easy:
In addition to the question of where to check the permissions, there's also the issue that the allow.vmm parameter shouldn't exist in a non-VMM system. This means the SYSCTL_JAIL_PARAM should be defined in vmm_dev.c or some other vmm-related file; that way, if VMM is loaded as a module, the parameter would be attached to that module.
Jul 4 2018
Jul 3 2018
Jun 28 2018
Jun 18 2018
May 24 2018
What does this buy us? What I can come up with is:
May 4 2018
Mar 22 2018
Once again, this time actually updating the diff...
As suggested by bz@, I've only removed the sysctls #ifdef BURN_BRIDGES.
I have another revision in the works, D14791, which removes those deprecated global permission parameters. Since this patch works with those parameters, I would naturally adjust whichever one goes in last (provided I get away with the parameter removal).
Te latest diff, to account for the changes I committed to neaten the somewhat messy pr_allow_names/pr_allow_nonames array pairs. And I also went with bumping VFS_VERSION instead of __FreeBSD_version.
Mar 21 2018
Mar 20 2018
Mar 18 2018
The latest changes:
- Put the bits back into pr_allow. Adding pr_allow_mount only served to duplicate code.
- Make the KBI change: put a prison flag in struct vfsconf.
- Replace prison_check_vfs with a call to prison_allow (another advantage of using pr_allow).
- Use asprintf in prison_add_vfs, instead of sprintf/strdup.
- Do the right thing ifdef NO_SYSCTL_DESCR.
Mar 14 2018
I've updated the diff to:
Mar 13 2018
Yes, I could do that - there are a few unused spots in struct prison to make it easy. Then I could leave pr_allow_names pretty much alone (except removing the old static allow.mount.*).
Mar 10 2018
Feb 28 2018
Nov 13 2017
Oct 29 2017
Oct 27 2017
I'm good with it - I was just waiting for suggested changed to make it in.
Oct 25 2017
One more thing to make it complete: something in the jail(8) man page. There's a pseudo-parameters section for things that aren't part of the kernel interface, where this would belong.
Now that it's not really part of the exec system (aside from execing a program itself for convenience), exec.cpuset doesn't sound like the best name. I think cpuset.list would be good, or at least something under the cpuset.* umbrella since cpuset.id already exists.