User Details
- User Since
- Aug 3 2014, 10:29 PM (624 w, 9 h)
Sun, Jul 5
Thu, Jul 2
Fix variable declaration order.
Wed, Jul 1
Clean up prison_attach_thread_single a bit so I don't need to different PROC_UNLOCK calls.
Move thread_single calls and related code inside a well-commented
wrapper function. Add atomic_load to the process flag read. Fix
tests so they can run in parallel, other small fixes.
Sun, Jun 28
Fri, Jun 26
Add a test for races between jail_attach_jd and chroot. Let all the tests run instead of stopping on the first failure.
I altered the patch to use an sx lock instead of thread single, and it passed the test as expected. But then I added a test for a race between jail_attach_jd and chroot, and it failed.
That's why it's EPERM to jail_attach with any directory fds open. But a concurrent chdir/chroot could work around that, e.g. if the jail_attach happens between path lookup and pwd_chroot().
I'll have to think a little on the chdir question. I considered it and chroot briefly, but only after I decided on single threading anyway, and I figured they weren't a problem because of the boundary requirement. Without that, it seems likely that a jail_attach in parallel with a chroot would have the same outcome.
I could do that, but I actually considered single threading to be the smaller hammer, because it only affects other threads in the process instead of any process attaching to any jail. But even if not single threading, I could have a jail_attach sx that's only used for multi-threaded processes.
Move the thread_single and thread_single_end calls from do_jail_attach to the system call level (kern_jail_set, sys_jail_attach, sys_jail_attach_jd). Return ERESTART instead of EAGAIN for lost races.
Thu, Jun 25
Wed, Jun 24
Tue, Jun 23
Don't change refcount_acquire to prison_proc_hold - the INVARIANTS test makes then not the same.
Sat, Jun 20
New diff with drflags pointer passed to do_jail_attach. I also removed the requirement that the jail be locked, which hasn't been the case since pr_ref and pr_uref went atomic.
Jun 19 2026
Removed an unrelated fix to a different jail_attach problem.
Jun 12 2026
Jun 9 2026
May 30 2026
Yes, the current setup is an ad-hoc mess, and could use some work. But maybe we *should* refactor the whole thing. Not to the point of ABI change with different parameters, but at least with enough specification inside to be able to know and report the state of subsystems. The current setup of a single bit works for the majority of systems, which can't be disabled. But the truly three-way systems could be standardized with separate "enabled" and "new" flags. There's usually a "real" state that uses something aside from a bit, such as the existence of the pr_addrs array, but these could exist along with the bitmask.
May 29 2026
The key point is "there aren't any other jps_get implementations." So it's all yours :-)
Only one little thing to go, so I'll call it approval. Since the parameter is allow.mount.all, the associated flag should be PR_ALLOW_MOUNT_ALL, not PR_ALLOW_MOUNT_ANY.
May 21 2026
No, I still hold that the extra level adds nothing.
May 15 2026
There's no need for the two-layer name "unsafe.all". If you really want both "unsafe" and "all" in the name allow.mount.unsafe_all should do. Better yet would be to keep is simple with allow.mount.all to allow all filesystems, with the understanding that such a thing might be unsafe. As it stands, there's this "allow.mount.unsafe" hierarchy, which suggests that allowing all filesystem types is unsafe, which each of those filesystem types is implicitly labeled as safe.
May 4 2026
PR_ALLOW_UNPRIV_PARENT_TAMPER is enough of a corner case (in restricting a parent jail) that I don't foresee anyone else calling prison_chain_allow. But perhaps that's just my own lack of imagination ;-)
Mar 13 2026
Mar 12 2026
This makes sense in if_vmove_reclaim, where the vnet comes from the held prison. But in if_vmove_loan, you're only holding the prison that will get the interface, not the one that currently has it. That wouldn't affect whether ifp currently belongs to a mid-shutdown vnet.
Feb 4 2026
Jan 27 2026
Simple from the jail perspective, not delving into the MAC part ;-)
Jan 16 2026
Jan 15 2026
Jan 14 2026
Why does it matter that putenv(3) doesn't create a copy?
Jan 6 2026
Dec 21 2025
Dec 17 2025
Dec 3 2025
Dec 2 2025
The original author should have done this in the first place ;-)
Nov 30 2025
Nov 7 2025
Nov 6 2025
While I prefer the version I mentioned in the inline notes (it's a little less branchy), I'm also fine with the patch as originally given.
Oct 24 2025
Oct 23 2025
Oct 22 2025
It only touches peripherally on jails, but sure, looks good. One could ask why we decided to have a separate and subtlely different "dist" and "distname" but I suppose that's water long since under the bridge.
Oct 21 2025
Oct 20 2025
Oct 19 2025
Sep 15 2025
Sep 13 2025
Commit 66d8ffe30 has simpler kevent handling for jaildesc, without any recursion. Jail kevents have also have recussion removed. Its lack of guarantees and incomplete problem-solving meant that applications would need a way to handle when notifications weren't 100% collected. As long as that's the case, might as well get rid of the complexity.
Commit 66d8ffe30 has simpler kevent handling for jaildesc, without any recursion. Jail kevents have also have recussion removed. Its lack of guarantees and incomplete problem-solving meant that applications would need a way to handle when notifications weren't 100% collected. As long as that's the case, might as well get rid of the complexity.
Sep 12 2025
Sep 10 2025
Very well. I suppose it doesn't hurt.
Sep 9 2025
Plan B is in D52462.
Plan A is in D52461.
Yes, EPERM on open directories may be unexpected, but I don't see that is enough cause to change the long-standing tradition of referring to other manual pages when a function may return the set of errors produced by another function.
