User Details
- User Since
- Aug 3 2014, 10:29 PM (461 w, 4 d)
Wed, Jun 7
Commited in eb5bfdd06565. I forgot to add the review to the commit message :-/
Sun, Jun 4
I've committed the "jails can include jails" and "use the recursive parser" bits separately. This new diff is just the part that handles the includes.
Thu, Jun 1
Wed, May 31
Simple include-loop prevention with via a maximum depth counter.
Fri, May 26
Rather than add a separate value different from the kern.fallback_elf_brand sysctl, it would make sense for the jail parameter to be tied to the sysctl itself, such as the securelevel parameter is. It's complicated somewhat by the fact that there are three similar sysctls.
Thu, May 25
Tue, May 23
True, they're not handled. I took my include inspiration from newsyslog (which has includes that also support globbing), and there it's also just a simple matter or running whatever it's told to include. It's kind of a footgun situation, where it's generally good enough to trust the administrator not to make such a loop. I did it for depend loops, but only because that's kind of elemental in building an acyclic directed graph.
Sun, May 21
New and improved diff :-)
I just created D40188, which is my take on solving this issue. It goes the include-file direction, and doesn't require and changes to rc.conf, since jail.conf is where such changes are made. The jail(8) command line also remains untouched.
May 5 2023
Mar 12 2023
s/novnetjail/nojailvnet/
Feb 21 2023
Feb 20 2023
This makes perfect sense to me. The original version only set redo_ip[46] provisionally , and I missed that the patch changed that.
Feb 4 2023
Feb 3 2023
I defined a function called vfs_exjail_delete(), which I currently
call from the nfsd'd OSD PR_MOETHOD_REMOVE which
releases credentials and set mnt_exjail NULL for all cases
matching the prison argument.
Maybe this function should be called from within kern_jail.c
via prison_cleanup()?
Jan 31 2023
The alive check raises a question: what if instead of a loop in vfs_export that checks prisons, how about a loop in prison_cleanup that checks exports? It could go through the mount list and any exports that belong to it can be refiled for the parent.
Jan 30 2023
Sure, this one's no biggie.
Jan 24 2023
I don't especially like the name pr_ident, which isn't readily differentiated from pr_id. Perhaps pr_permid? In a perfect world, I wouldn't have allowed prison IDs to be reused, but it's too late to stuff that horse back into the barn. Probably - I have considered actually changing the policy, but it would have POLA problems and would need a slow rollout with proper deprecation warnings.
Dec 31 2022
It took me longer to remember what I had done in the first place than it did to understand the new logic. I like this.
Dec 23 2022
Dec 22 2022
Dec 18 2022
Dec 17 2022
Dec 16 2022
Dec 15 2022
Dec 14 2022
Dec 13 2022
Dec 12 2022
Dec 11 2022
Yes, the warning is sufficient. As I mentioned, there are other cases where a jail is allowed to be created as long as its options are allowed, even if it turns out not to be "fit for purpose".
The thing about the vfs_opterror, is the error message only applies when the jail_set(2) fails (or at least it's only checked then). So If you want to still allow the jail to be created and only give a warning, then printf() is the way to go.
Dec 10 2022
Dec 9 2022
Also, the jail.8 man page should have the parameter, which is a good place to mention the requirements for using it.
What's the purpose of nfsd_call_vnet_cleanup being a function pointer? If it's because you need VNET_NFSD for it to exist, it should do to have #ifdef VNET_NFSD in prison_cleanup(). If it's to handle nfsd being dynamically loaded, the canonical way to handle it is via the OSD system, where the osd_jail_call(...PR_METHOD_REMOVE) would handle it. Or is there a third reason I don't know?
Aug 31 2022
Jul 3 2022
Jun 29 2022
May 16 2022
May 13 2022
Wow, that has been there for an embarrassingly long time!
Mar 28 2022
Mar 26 2022
Mar 12 2022
Mar 2 2022
Feb 27 2022
Feb 24 2022
Dec 19 2021
Dec 16 2021
Dec 15 2021
Dec 14 2021
I take it this is for what we're seeing in Bug 260335.
Dec 9 2021
Nov 11 2021
This presupposes that a jail that isn't marked to persist isn't going to stick around for some other reason. A jail could be started for example to start a long-running daemon, or to be a parent of other jails. Automatically going away when its task is done is a feature of such a jail.
Oct 7 2021
Sep 29 2021
Sep 4 2021
Jul 27 2021
I'm not thrilled at the redundant call to vfs_flagopt(), which shouldn't be necessary because kern_jail_set has already looked for allow.novmm and set the permission bit accordingly. But by the time vmmdev_prison_set() is called, the old value of the permission bit is forgotten. So you're left with
Jun 24 2021
Jun 18 2021
Apr 12 2021
Apr 11 2021
Apr 9 2021
Apr 8 2021
Yeah, I'd been meaning to get around to that ;-).
Apr 4 2021
Mar 14 2021
This would work well with jexec -l, which is already somewhat like su -l but misses the parts you mention. In fact, I would recommend making clean (-l) the deciding factor instead of pwd (-u/U). And I don't see a reason why the same directory change shouldn't be done regardless of whether it's for a command or a shell.