Page MenuHomeFreeBSD

JailsGroup
ActivePublic

Recent Activity

Yesterday

netchild added a comment to D62306: jail: optimize prison lookups by name.

[P2] KBI: the layout of struct prison (applies to D61328 as well) — sys/sys/jail.h:279

Sat, Dec 5, 12:28 PM · Jails

Wed, Dec 2

yura.tkachenko_gmail.com added a reviewer for D62306: jail: optimize prison lookups by name: Jails.
Wed, Dec 2, 12:35 AM · Jails
yura.tkachenko_gmail.com requested review of D62306: jail: optimize prison lookups by name.
Wed, Dec 2, 12:31 AM · Jails

Tue, Dec 1

dteske added a comment to D62026: enjail: Add a sandbox jail utility.

The enjail has some interesting ideas.
I have a use case where we need to run some command (cli) inside jail but jail doesn't package these CLIs for number of reasons (security is one of them). These CLIs are available on the host and it would be nice to do this:
jexec -m /mnt/oci_cli:/opt/oci_cli <jail> /opt/oci_cli/bin/lb_image_upgrade lb_v_1_0 lb_v_2_0

Tue, Dec 1, 5:23 PM · Jails
yura.tkachenko_gmail.com added a comment to D62026: enjail: Add a sandbox jail utility.

The enjail has some interesting ideas.
I have a use case where we need to run some command (cli) inside jail but jail doesn't package these CLIs for number of reasons (security is one of them). These CLIs are available on the host and it would be nice to do this:
jexec -m /mnt/oci_cli:/opt/oci_cli <jail> /opt/oci_cli/bin/lb_image_upgrade lb_v_1_0 lb_v_2_0

Tue, Dec 1, 1:43 AM · Jails

Sun, Nov 29

dteske added a comment to D62026: enjail: Add a sandbox jail utility.

In D62026#1425442, @arrowd wrote:
I didn't look into details, but chances are you're inventing https://github.com/containers/bubblewrap
It'd be great to have our compatible implementation of bubblewrap instead of a completely new CLI utility.
I know at least one port that would benefit from the native bwrap.

Sun, Nov 29, 8:18 PM · Jails
arrowd added a comment to D62026: enjail: Add a sandbox jail utility.

I didn't look into details, but chances are you're inventing https://github.com/containers/bubblewrap
It'd be great to have our compatible implementation of bubblewrap instead of a completely new CLI utility.
I know at least one port that would benefit from the native bwrap.

Sun, Nov 29, 5:59 PM · Jails

Fri, Nov 27

dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

rebase --onto nullfs_ephemeral HEAD~1

Fri, Nov 27, 12:01 AM · Jails

Thu, Nov 26

netchild added a comment to D58089: kern: set UF_RESOLVE_BENEATH on all fds during jail attach.
  • [P3] Shared fd tables. After rfork() without RFFDG, the fd table is shared with a process outside the jail. The loop then marks that process's fds too. Fds it opens later reach the jailed process without the flag.
Thu, Nov 26, 8:07 PM · Jails
netchild added a comment to D58080: fdescfs: enforce access rights on nodup reopens.
  • [P1] Built on something main doesn't have. It uses D58079's td_dupfd mechanism. It doesn't apply (vfs_syscalls.c:1329) and has to be rebuilt on markj's nameidata path, for example by passing the original fd's f_flag up beside ni_filecaps.
  • [P1] The check runs too late. It runs after vn_open_cred() and after fo_truncate(). So open("/dev/fd/N", O_RDWR|O_TRUNC) on a read-only fd empties the file first and only then fails with EACCES. O_RDONLY|O_TRUNC gets past the check completely, because O_TRUNC isn't recorded in f_flag.
  • See also my comment in D58081.
Thu, Nov 26, 8:04 PM · Jails
netchild added a comment to D58081: kern: enforce access rights on O_EMPTY_PATH reopens with FD_RESOLVE_BENEATH.
  • [P1] O_TRUNC gets around the check. OPENWRITE is set only when FWRITE is. So openat(fd, "", O_EMPTY_PATH|O_RDONLY|O_TRUNC) (or O_EXEC|O_TRUNC) passes. Jailed root then gets VWRITE and the file is truncated. With the summary's own jail.conf example, nobody can add hooks, but they can empty the file. Moving the check into vn_open_vnode(), where the open flags are known, would cover this and D58080 with one check.
  • [P2] False EACCES on normal opens. The check doesn't test for an empty path. So openat(dfd, "sub/f", O_RDWR|O_EMPTY_PATH) fails, while the same call without O_EMPTY_PATH succeeds.
  • [P3] The FD_RESOLVE_BENEATH text in fcntl(2) lists each of its restrictions. The new one should be added there.
Thu, Nov 26, 8:02 PM · Jails
dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

rebase --onto nullfs_ephemeral HEAD~1

Thu, Nov 26, 7:48 PM · Jails
crest_freebsd_rlwinm.de changed the visibility for D58089: kern: set UF_RESOLVE_BENEATH on all fds during jail attach.
Thu, Nov 26, 5:11 PM · Jails
crest_freebsd_rlwinm.de changed the visibility for D58081: kern: enforce access rights on O_EMPTY_PATH reopens with FD_RESOLVE_BENEATH.
Thu, Nov 26, 5:11 PM · Jails
crest_freebsd_rlwinm.de changed the visibility for D58080: fdescfs: enforce access rights on nodup reopens.
Thu, Nov 26, 5:10 PM · Jails
crest_freebsd_rlwinm.de changed the visibility for D58079: fdescfs: preserve FD_RESOLVE_BENEATH across nodup reopens.
Thu, Nov 26, 5:10 PM · Jails
dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

rebase --onto nullfs_ephemeral HEAD~1

Thu, Nov 26, 4:42 AM · Jails
imp added a comment to D62026: enjail: Add a sandbox jail utility.

I'd like to suggest having a lot of this discussion in arch@. This one review seems a bit obscure for the how it works parts of the discussion. There's a lot of detail that relies on a lot of new kernel features that should be hadhed out in front of a larger audience.

Thu, Nov 26, 4:06 AM · Jails
dteske updated subscribers of D62026: enjail: Add a sandbox jail utility.

Defects:

  • [P1] -w/-W source is checked, then resolved again. enjail_check_w uses readlink, later mount_nullfs(8) runs realpath(3) on the same string in the host's namespace. The live jail's root can swap a component for a symlink in between, and a host file becomes writable in the sandbox. jail(8)'s check_path only covers the mount point side, and only by lstat. Window is real; not raced.

Yes, you're describing a TOCTOU-safety issue. I was aware of this and I have a solution, but I side-lined it for now because it means modifying the kernel more, and I wanted to keep the kernel modifications to a minimum, so leaving this vulnerability for a later fix was the trade-off.

If dir is never in use by a running jail, nobody is there to race, so this can be handled without kernel changes: refuse a dir which is, contains, or is below the path of a running jail (jls path). A tree that is also visible in another running jail through nullfs is not found this way, that would go into the man page.

Thu, Nov 26, 1:24 AM · Jails

Wed, Nov 25

dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

rebase --onto nullfs_ephemeral HEAD~1

Wed, Nov 25, 11:21 PM · Jails
netchild added a comment to D62026: enjail: Add a sandbox jail utility.

Defects:

  • [P1] enjail:1-1147 jail(8) prints on enjail's stdout. jail -c without -q writes "<name>: created" to stdout (command.c, verbose >= 0 && j->name). enjail -c then prints two lines, and the one-shot command's output starts with it. D61938 takes that stdout as a file list, so a write without -f would pass "enjail_...: created" to -w. Trigger: any successful run. Fix: -q.

Yes, I haven't tested this yet because the test process requires patching my kernel and running a patched nullfs.ko, and this is a draft (and I was inviting this exact type of feedback because I didn't want to continue spending more time developing further code before I got some feedback on the approach first).

  • [P1] -w/-W source is checked, then resolved again. enjail_check_w uses readlink, later mount_nullfs(8) runs realpath(3) on the same string in the host's namespace. The live jail's root can swap a component for a symlink in between, and a host file becomes writable in the sandbox. jail(8)'s check_path only covers the mount point side, and only by lstat. Window is real; not raced.

Yes, you're describing a TOCTOU-safety issue. I was aware of this and I have a solution, but I side-lined it for now because it means modifying the kernel more, and I wanted to keep the kernel modifications to a minimum, so leaving this vulnerability for a later fix was the trade-off.

Wed, Nov 25, 9:22 PM · Jails
dteske added a comment to D62026: enjail: Add a sandbox jail utility.

My thought process was along the lines of ... what if a VPS-owner becomes disgruntled and drops creates /etc/defaults/vendor.conf with the following:

Wed, Nov 25, 11:46 AM · Jails
crest_freebsd_rlwinm.de added a comment to D62026: enjail: Add a sandbox jail utility.

A generic comment: It is not clear to me what your target is for "enjail".

Sure, let me just throw everyone under the bus then, including myself.

iocage issue #163 and #164 and #165 detail issues with rc.conf being shell and inculcating my sysrc in a jail-break. Put quite simply:

  1. Because rc.conf is shell
  2. Using sysrc to bootstrap a jail that is not-yet running
  3. Results in the potential for commands running as root
Wed, Nov 25, 11:24 AM · Jails
dteske added a comment to D62026: enjail: Add a sandbox jail utility.

Improvement suggestions:

Wed, Nov 25, 8:21 AM · Jails
dteske added a comment to D62026: enjail: Add a sandbox jail utility.

Defects:

  • [P1] enjail:1-1147 jail(8) prints on enjail's stdout. jail -c without -q writes "<name>: created" to stdout (command.c, verbose >= 0 && j->name). enjail -c then prints two lines, and the one-shot command's output starts with it. D61938 takes that stdout as a file list, so a write without -f would pass "enjail_...: created" to -w. Trigger: any successful run. Fix: -q.
Wed, Nov 25, 8:15 AM · Jails
dteske added a comment to D62026: enjail: Add a sandbox jail utility.

A generic comment: It is not clear to me what your target is for "enjail".

Wed, Nov 25, 7:53 AM · Jails
netchild added a comment to D62026: enjail: Add a sandbox jail utility.

A generic comment: It is not clear to me what your target is for "enjail". You call it a sandbox. A sandbox is very strict in what it allows. "enjail" sounds to me more like a quick jailing solution, with the usual jail defaults. I wouldn't call it "enjail" if the purpose is a strict sandbox. The following review assumes the sandbox meaning. I would consider a sandbox feature a nice to have, and agree with Warner about having a wider discussion about it in e.g. arch@.

Wed, Nov 25, 6:58 AM · Jails
dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

Update $Title$ and enjail.8 .Nd

Wed, Nov 25, 6:17 AM · Jails
imp added a comment to D62026: enjail: Add a sandbox jail utility.

This likely requires wider discussion and buy-in to be in base.

Wed, Nov 25, 5:47 AM · Jails
dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

comments + rebase --onto nullfs_ephemeral HEAD~1

Wed, Nov 25, 5:14 AM · Jails
dteske updated the diff for D62026: enjail: Add a sandbox jail utility.

Use short form license header on enjail.8 (seuros)

Wed, Nov 25, 5:10 AM · Jails

Tue, Nov 24

dteske added a project to D62026: enjail: Add a sandbox jail utility: Jails.
Tue, Nov 24, 10:32 PM · Jails

Oct 8 2026

dtxdf closed D60133: sysutils/buildah: Add a patch to correctly preserve setuid/setgid bits.
Oct 8 2026, 6:36 AM · Jails
dtxdf added a comment to D60133: sysutils/buildah: Add a patch to correctly preserve setuid/setgid bits.

Thanks!

Oct 8 2026, 6:31 AM · Jails

Oct 5 2026

jamie closed D60392: jaildesc: Lock prison pointer when filling kinfo.
Oct 5 2026, 11:57 PM · Jails
yura.tkachenko_gmail.com added a comment to D60392: jaildesc: Lock prison pointer when filling kinfo.

I don't see you on the committer list - do you want me to commit this for you?

Oct 5 2026, 11:48 PM · Jails
jamie accepted D60392: jaildesc: Lock prison pointer when filling kinfo.

I don't see you on the committer list - do you want me to commit this for you?

Oct 5 2026, 11:31 PM · Jails
yura.tkachenko_gmail.com requested review of D60392: jaildesc: Lock prison pointer when filling kinfo.
Oct 5 2026, 11:06 PM · Jails
dfr accepted D60133: sysutils/buildah: Add a patch to correctly preserve setuid/setgid bits.

Looks good - please go ahead and commit.

Oct 5 2026, 1:24 PM · Jails
dtxdf added a comment to D60133: sysutils/buildah: Add a patch to correctly preserve setuid/setgid bits.

ping

Oct 5 2026, 6:47 AM · Jails

Oct 3 2026

yura.tkachenko_gmail.com added a member for Jails: yura.tkachenko_gmail.com.
Oct 3 2026, 6:55 AM

Sep 29 2026

dtxdf requested review of D60133: sysutils/buildah: Add a patch to correctly preserve setuid/setgid bits.
Sep 29 2026, 4:41 PM · Jails

Sep 10 2026

olce added a member for Jails: olce.
Sep 10 2026, 3:37 PM

Aug 28 2026

dtxdf added a comment to D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.
In D59158#1359158, @dfr wrote:

This change should merge cleanly to stable/15 - it would be nice to have this feature available in FreeBSD 15.2

Aug 28 2026, 4:01 PM · Jails
dfr added a comment to D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.

This change should merge cleanly to stable/15 - it would be nice to have this feature available in FreeBSD 15.2

Aug 28 2026, 2:47 PM · Jails
dtxdf closed D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.
Aug 28 2026, 5:19 AM · Jails

Aug 26 2026

dfr accepted D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.

Looks good to me, although I haven't tested it yet.

Aug 26 2026, 9:14 AM · Jails

Aug 24 2026

dtxdf added a comment to D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.

manpage changes looks good, should we Relnotes this?

Aug 24 2026, 11:38 PM · Jails
ziaee added a comment to D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.

manpage changes looks good, should we Relnotes this?

Aug 24 2026, 9:05 PM · Jails
dtxdf updated the diff for D59158: nullfs: Allow VSOCK to be mounted on top of another VSOCK.
  • Update man page.
Aug 24 2026, 7:23 PM · Jails