Page MenuHomeFreeBSD

jamie (James Gritton)
User

Projects

User Details

User Since
Aug 3 2014, 10:29 PM (624 w, 9 h)

Recent Activity

Sun, Jul 5

jamie accepted D58049: jaildesc: Publish the new fd only after the jaildesc is initialized.
Sun, Jul 5, 10:01 PM
jamie committed rG5ba2b4f773c2: jail: prevent a race between jail_attach in different threads (authored by jamie).
jail: prevent a race between jail_attach in different threads
Sun, Jul 5, 5:14 AM
jamie committed rG530ee2980c50: jail: clean up locking around do_jail_attach (authored by jamie).
jail: clean up locking around do_jail_attach
Sun, Jul 5, 5:14 AM
jamie committed rG334c8ba7dd9c: jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails (authored by jamie).
jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails
Sun, Jul 5, 5:14 AM
jamie committed rGa4df9e3efa30: jail: prevent a race between jail_attach in different threads (authored by jamie).
jail: prevent a race between jail_attach in different threads
Sun, Jul 5, 2:55 AM
jamie committed rGaca9811160f4: jail: prevent a null derefence on array parameter assignment (authored by jamie).
jail: prevent a null derefence on array parameter assignment
Sun, Jul 5, 2:51 AM
jamie committed rGcb0b277f71b6: jail: prevent a null derefence on array parameter assignment (authored by jamie).
jail: prevent a null derefence on array parameter assignment
Sun, Jul 5, 2:51 AM

Thu, Jul 2

jamie closed D57858: Prevent a jail_attach race between threads.
Thu, Jul 2, 10:52 PM
jamie committed rGd4e0f4dab2d7: jail: prevent a race between jail_attach in different threads (authored by jamie).
jail: prevent a race between jail_attach in different threads
Thu, Jul 2, 10:52 PM
jamie updated the diff for D57858: Prevent a jail_attach race between threads.

Fix variable declaration order.

Thu, Jul 2, 12:26 AM

Wed, Jul 1

jamie updated the diff for D57858: Prevent a jail_attach race between threads.

Clean up prison_attach_thread_single a bit so I don't need to different PROC_UNLOCK calls.

Wed, Jul 1, 11:56 PM
jamie added inline comments to D57858: Prevent a jail_attach race between threads.
Wed, Jul 1, 7:40 PM
jamie updated the diff for D57858: Prevent a jail_attach race between threads.

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.

Wed, Jul 1, 7:37 PM
jamie committed rG6d9bc46cd7fc: jail: prevent a null derefence on array parameter assignment (authored by jamie).
jail: prevent a null derefence on array parameter assignment
Wed, Jul 1, 6:38 PM

Sun, Jun 28

jamie committed rG8f14ea499fc6: jail: clean up locking around do_jail_attach (authored by jamie).
jail: clean up locking around do_jail_attach
Sun, Jun 28, 4:08 PM

Fri, Jun 26

jamie updated the diff for D57858: Prevent a jail_attach race between threads.

Add a test for races between jail_attach_jd and chroot. Let all the tests run instead of stopping on the first failure.

Fri, Jun 26, 8:04 PM
jamie added a comment to D57858: Prevent a jail_attach race between threads.

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.

Fri, Jun 26, 7:21 PM
jamie added a comment to D57858: Prevent a jail_attach race between threads.

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().

Fri, Jun 26, 6:50 AM
jamie added a comment to D57858: Prevent a jail_attach race between threads.

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.

Fri, Jun 26, 6:08 AM
jamie added a comment to D57858: Prevent a jail_attach race between threads.

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.

Fri, Jun 26, 5:43 AM
jamie added inline comments to D57858: Prevent a jail_attach race between threads.
Fri, Jun 26, 4:35 AM
jamie updated the diff for D57858: Prevent a jail_attach race between threads.

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.

Fri, Jun 26, 4:33 AM
jamie added inline comments to D57858: Prevent a jail_attach race between threads.
Fri, Jun 26, 2:39 AM

Thu, Jun 25

jamie requested review of D57858: Prevent a jail_attach race between threads.
Thu, Jun 25, 11:07 PM
jamie committed rG3584cde63e41: jail: clean up locking around do_jail_attach (authored by jamie).
jail: clean up locking around do_jail_attach
Thu, Jun 25, 3:24 AM

Wed, Jun 24

jamie committed rG315238df5323: jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails (authored by jamie).
jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails
Wed, Jun 24, 5:48 PM

Tue, Jun 23

jamie updated the diff for D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .

Don't change refcount_acquire to prison_proc_hold - the INVARIANTS test makes then not the same.

Tue, Jun 23, 10:16 PM
jamie added inline comments to D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .
Tue, Jun 23, 10:15 PM

Sat, Jun 20

jamie updated the diff for D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .

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.

Sat, Jun 20, 7:53 PM
jamie added inline comments to D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .
Sat, Jun 20, 3:45 PM
jamie accepted D57697: kern: add a security knob to disable unprivileged access to kenv.
Sat, Jun 20, 1:34 PM

Jun 19 2026

jamie committed rGe91e8ebefadc: jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails (authored by jamie).
jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails
Jun 19 2026, 7:46 PM
jamie updated the diff for D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .

Removed an unrelated fix to a different jail_attach problem.

Jun 19 2026, 6:24 PM
jamie added inline comments to D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .
Jun 19 2026, 5:56 PM
jamie requested review of D57674: Clean up locking around do_jail_attach, fixing zombie jails from jail_attach_jd .
Jun 19 2026, 5:51 PM

Jun 12 2026

jamie committed rG4938fd9361b4: jail: Don't double-free the current prison in kern_jail_set/get (authored by jamie).
jail: Don't double-free the current prison in kern_jail_set/get
Jun 12 2026, 6:00 PM

Jun 9 2026

jamie committed rGb52dc2067618: jail: Don't double-free the current prison in kern_jail_set/get (authored by jamie).
jail: Don't double-free the current prison in kern_jail_set/get
Jun 9 2026, 10:33 PM

May 30 2026

jamie added a comment to D57278: sys/kern/kern_jail: Improve subsystem flag handling.

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 30 2026, 11:32 PM

May 29 2026

jamie accepted D57280: libjail: fix fetching mac.label for multiple jails.

The key point is "there aren't any other jps_get implementations." So it's all yours :-)

May 29 2026, 7:34 PM
jamie accepted D56967: jail: add allow.mount.all to allow mounting any filesystem.

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 29 2026, 4:39 AM

May 21 2026

jamie added a comment to D56967: jail: add allow.mount.all to allow mounting any filesystem.

No, I still hold that the extra level adds nothing.

May 21 2026, 10:59 PM

May 15 2026

jamie added a comment to D56967: jail: add allow.mount.all to allow mounting any filesystem.

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 15 2026, 6:15 PM

May 4 2026

jamie accepted D54992: kern: better hierarchical jail semantics for ALLOW_UNPRIV_PARENT_TAMPER.

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 ;-)

May 4 2026, 9:51 PM

Mar 13 2026

jamie accepted D55828: ifnet: Remove unreachable code.
Mar 13 2026, 5:01 PM
jamie added inline comments to D55832: ifnet: if_vmove_(loan|reclaim): Refactor a bit the checking of src / dst vnet.
Mar 13 2026, 4:57 PM

Mar 12 2026

jamie added a comment to D55828: ifnet: Remove unreachable code.

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.

Mar 12 2026, 5:07 PM

Feb 4 2026

jamie added a comment to D55066: vmm: Allow the use of PCI passthrough in a jail.
In D55066#1259408, @bz wrote:

My historic understanding was that we would have all the pr_* options/check inside kern_jail.c and have accessor functions for them passing td or cred.

Yes, this would be better, but I followed the pattern of the existing allow.vmm knob. I suspect it should be defined in kern_jail.c, not in vmm.ko, so that prison_priv_check() can access it. If there is some consensus on this I'll make that change.

Feb 4 2026, 6:30 PM

Jan 27 2026

jamie accepted D54833: kern: mac: add a prison_cleanup entry point.

Simple from the jail perspective, not delving into the MAC part ;-)

Jan 27 2026, 6:32 PM

Jan 16 2026

jamie accepted D54737: RELNOTES: document the MAC/jail integration.
Jan 16 2026, 1:10 AM

Jan 15 2026

jamie accepted D54660: jexec: Add -e parameter to customize the environment.
Jan 15 2026, 12:18 AM · Jails

Jan 14 2026

jamie added inline comments to D54660: jexec: Add -e parameter to customize the environment.
Jan 14 2026, 6:45 PM · Jails
jamie added a comment to D54660: jexec: Add -e parameter to customize the environment.

Why does it matter that putenv(3) doesn't create a copy?

Jan 14 2026, 12:50 AM · Jails

Jan 6 2026

jamie accepted D53954: [RFC] kern: mac: add various jail MAC hooks.
Jan 6 2026, 5:46 PM

Dec 21 2025

jamie added inline comments to D53958: kern: add a mac.label jail parameter.
Dec 21 2025, 6:00 PM

Dec 17 2025

jamie accepted D54271: jail: Don't define malloc type M_PRISON_RACCT on !RACCT.
Dec 17 2025, 5:46 PM

Dec 3 2025

jamie added inline comments to D53958: kern: add a mac.label jail parameter.
Dec 3 2025, 8:57 PM

Dec 2 2025

jamie added inline comments to D53954: [RFC] kern: mac: add various jail MAC hooks.
Dec 2 2025, 5:07 PM
jamie added inline comments to D53953: kern: mac: add a MAC label to struct prison.
Dec 2 2025, 4:59 PM
jamie accepted D53960: libjail: extend struct handlers to included MAC labels.
Dec 2 2025, 4:29 AM
jamie accepted D53959: libjail: start refactoring struct ioctl support.

The original author should have done this in the first place ;-)

Dec 2 2025, 4:25 AM
jamie added inline comments to D53958: kern: add a mac.label jail parameter.
Dec 2 2025, 4:24 AM
jamie accepted D53956: mac_set_fd(3): add support for jail descriptors.
Dec 2 2025, 4:17 AM
jamie accepted D53955: jaildesc: add an accessor for the struct prison in a jaildesc.
Dec 2 2025, 4:16 AM
jamie added inline comments to D53954: [RFC] kern: mac: add various jail MAC hooks.
Dec 2 2025, 4:16 AM
jamie added inline comments to D53953: kern: mac: add a MAC label to struct prison.
Dec 2 2025, 4:15 AM

Nov 30 2025

jamie committed R9:d255e1a4d565: releases/15.0R/relnotes: note jail descriptors and kevent filters (authored by jamie).
releases/15.0R/relnotes: note jail descriptors and kevent filters
Nov 30 2025, 6:39 PM

Nov 7 2025

jamie accepted D53631: jail.8: Add creating a jail from distribution set.
Nov 7 2025, 5:38 PM

Nov 6 2025

jamie accepted D53612: kern_jail_set(): do not double-free opts.

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.

Nov 6 2025, 5:20 PM

Oct 24 2025

jamie committed rGc6bf733736b5: jail: fix an error condition that was returned without setting errno. (authored by jamie).
jail: fix an error condition that was returned without setting errno.
Oct 24 2025, 1:12 AM

Oct 23 2025

jamie committed rG2d3c6a06edc3: jail: fix a regression that creates zombies when removing dying jails (authored by jamie).
jail: fix a regression that creates zombies when removing dying jails
Oct 23 2025, 4:37 AM

Oct 22 2025

jamie accepted D53177: bsdinstall: jail: Fix DISTMENU items.

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 22 2025, 6:03 PM

Oct 21 2025

jamie committed rG5f7d5709e0c2: jail: fix an error condition that was returned without setting errno. (authored by jamie).
jail: fix an error condition that was returned without setting errno.
Oct 21 2025, 12:10 AM

Oct 20 2025

jamie committed rG78f70d4ff9dd: jail: fix a regression that creates zombies when removing dying jails (authored by jamie).
jail: fix a regression that creates zombies when removing dying jails
Oct 20 2025, 4:55 PM
jamie closed D53200: Fix a regression that creates zombies when removing already-dying jails.
Oct 20 2025, 4:54 PM

Oct 19 2025

jamie requested review of D53200: Fix a regression that creates zombies when removing already-dying jails.
Oct 19 2025, 5:55 PM

Sep 15 2025

jamie committed rGdeaa609d065d: jaildesc: remove desc from the sysctl parameter list (authored by jamie).
jaildesc: remove desc from the sysctl parameter list
Sep 15 2025, 4:05 AM
jamie committed rG9d7f89ef2607: jaildesc: add kevent support (authored by jamie).
jaildesc: add kevent support
Sep 15 2025, 4:05 AM
jamie committed rG1a849ff1e9a9: jail: simplify EVFILT_JAIL events (authored by jamie).
jail: simplify EVFILT_JAIL events
Sep 15 2025, 4:04 AM

Sep 13 2025

jamie committed rG5df0b57b74e2: MFC jaildesc: remove file-mode-based access controls (authored by jamie).
MFC jaildesc: remove file-mode-based access controls
Sep 13 2025, 11:45 PM
jamie committed rG0c23ee96c6e5: MFC jaildesc: fix typo and style(9) violations. (authored by jamie).
MFC jaildesc: fix typo and style(9) violations.
Sep 13 2025, 11:45 PM
jamie committed rG595a705062de: MFC jaildesc: replace EBADF with EINVAL (authored by jamie).
MFC jaildesc: replace EBADF with EINVAL
Sep 13 2025, 11:45 PM
jamie committed rG4ecbb3f19b44: MFC jaildesc: fix a misplaced error check and a spurious finit call (authored by jamie).
MFC jaildesc: fix a misplaced error check and a spurious finit call
Sep 13 2025, 11:45 PM
jamie committed rGe75dda31c1ee: jaildesc: remove desc from the sysctl parameter list (authored by jamie).
jaildesc: remove desc from the sysctl parameter list
Sep 13 2025, 10:32 PM
jamie requested review of D52516: Add capsicum support to jail descriptors.
Sep 13 2025, 9:20 PM
jamie abandoned D52462: Jail descriptor kevents, Plan B.

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 13 2025, 3:52 AM
jamie abandoned D52461: Jail descriptor kevents, Plan A.

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 13 2025, 3:52 AM

Sep 12 2025

jamie committed rG66d8ffe3046d: jaildesc: add kevent support (authored by jamie).
jaildesc: add kevent support
Sep 12 2025, 6:35 PM
jamie committed rGdbcaac13e49c: jail: simplify EVFILT_JAIL events (authored by jamie).
jail: simplify EVFILT_JAIL events
Sep 12 2025, 5:29 AM

Sep 10 2025

jamie committed rGd81b337d690c: jaildesc: remove file-mode-based access controls (authored by jamie).
jaildesc: remove file-mode-based access controls
Sep 10 2025, 11:27 PM
jamie accepted D52319: jail.2: Mention EPERM is returned on open directories.

Very well. I suppose it doesn't hurt.

Sep 10 2025, 5:35 PM

Sep 9 2025

jamie committed rGd8d5324ef533: jaildesc: fix typo and style(9) violations. (authored by jamie).
jaildesc: fix typo and style(9) violations.
Sep 9 2025, 6:53 PM
jamie committed rG16f600dc30b7: jaildesc: replace EBADF with EINVAL (authored by jamie).
jaildesc: replace EBADF with EINVAL
Sep 9 2025, 6:18 PM
jamie added a comment to D52461: Jail descriptor kevents, Plan A.

Plan B is in D52462.

Sep 9 2025, 4:57 PM
jamie added a comment to D52462: Jail descriptor kevents, Plan B.

Plan A is in D52461.

Sep 9 2025, 4:57 PM
jamie requested review of D52462: Jail descriptor kevents, Plan B.
Sep 9 2025, 4:37 PM
jamie requested review of D52461: Jail descriptor kevents, Plan A.
Sep 9 2025, 4:30 PM
jamie added a comment to D52319: jail.2: Mention EPERM is returned on open directories.

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.

Sep 9 2025, 3:50 PM

Sep 5 2025

jamie committed rG8ec7a830f10b: jaildesc: fix a misplaced error check and a spurious finit call (authored by jamie).
jaildesc: fix a misplaced error check and a spurious finit call
Sep 5 2025, 4:51 AM
jamie closed D43696: Jail descriptors.
Sep 5 2025, 3:51 AM

Sep 4 2025

jamie committed rG851dc7f859c2: jail: add jail descriptors (authored by jamie).
jail: add jail descriptors
Sep 4 2025, 8:32 PM