Page MenuHomeFreeBSD
Feed Advanced Search

May 4 2018

jamie closed D14681: Dynamically add jail-enabled filesystems.
May 4 2018, 8:54 PM

Mar 22 2018

jamie updated the diff for D14791: Remove deprecated jail global permission sysctls, and make jail(2) COMPAT_FREEBSD11.

Once again, this time actually updating the diff...

Mar 22 2018, 3:39 PM · committers
jamie updated the diff for D14791: Remove deprecated jail global permission sysctls, and make jail(2) COMPAT_FREEBSD11.

As suggested by bz@, I've only removed the sysctls #ifdef BURN_BRIDGES.

Mar 22 2018, 3:37 PM · committers
jamie added a comment to D14681: Dynamically add jail-enabled filesystems.

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

Mar 22 2018, 4:08 AM
jamie updated the diff for D14681: Dynamically add jail-enabled filesystems.

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 22 2018, 4:07 AM
jamie created D14791: Remove deprecated jail global permission sysctls, and make jail(2) COMPAT_FREEBSD11.
Mar 22 2018, 3:56 AM · committers

Mar 21 2018

jamie committed rS331332: If a jail parameter isn't found, try loading a related kernel module..
If a jail parameter isn't found, try loading a related kernel module.
Mar 21 2018, 11:51 PM

Mar 20 2018

jamie committed rS331278: Represent boolean jail options as an array of structures containing the.
Represent boolean jail options as an array of structures containing the
Mar 20 2018, 11:08 PM

Mar 18 2018

jamie added a comment to D14681: Dynamically add jail-enabled filesystems.
In D14681#309678, @kib wrote:

I you might want to bump VFS_VERSION instead of __FreeBSD_version.

Mar 18 2018, 7:11 PM
jamie added inline comments to D14681: Dynamically add jail-enabled filesystems.
Mar 18 2018, 6:41 PM
jamie updated the diff for D14681: Dynamically add jail-enabled filesystems.

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 18 2018, 3:17 AM

Mar 14 2018

jamie added inline comments to D14681: Dynamically add jail-enabled filesystems.
Mar 14 2018, 11:02 PM
jamie updated the diff for D14681: Dynamically add jail-enabled filesystems.

I've updated the diff to:

Mar 14 2018, 4:45 AM
jamie added a comment to D14681: Dynamically add jail-enabled filesystems.
In D14681#308570, @jhb wrote:

One more thought: if you use the value from 'vfc_name' as the pointer you set in the array, you don't have to do actual string comparisons but can just do pointer compares to find the matching index (and thus bit) in the array in prison_check_vfs(). The jail parameter logic would still have to do string compares though.

Mar 14 2018, 1:29 AM

Mar 13 2018

jamie added a comment to D14681: Dynamically add jail-enabled filesystems.
In D14681#308541, @jhb wrote:

For per-jail settings I would still be tempted to not try to reserve space in the names, but instead perhaps have a separate "allow" mask just for VFS, and parse mount parameters explicitly.

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 13 2018, 11:41 PM
jamie added a comment to D14681: Dynamically add jail-enabled filesystems.
In D14681#308495, @jhb wrote:

... You could just add a new 'VFCF_JAIL_ALLOW' which is a dynamic flag that the sysctl knobs turn on/off. The sysctl node would be a SYSCTL_PROC handler and it can take a pointer to the 'struct vfsconf' as its arg2 value.

Mar 13 2018, 7:58 PM
jamie added a comment to D14681: Dynamically add jail-enabled filesystems.
In D14681#308495, @jhb wrote:

I'm not quite a fan of the manual sysctl tree walking. I also don't think you need to worry about pre-creating sysctls if they are written to. I think it is perfectly reasonable to only create the sysctl when the VFS module is loaded (and that's more typical). I think it is cleaner instead of allocating pr_allow bits on the fly, to instead use a flag in the 'struct vfsconf' to be the jail permission. You could just add a new 'VFCF_JAIL_ALLOW' which is a dynamic flag that the sysctl knobs turn on/off. The sysctl node would be a SYSCTL_PROC handler and it can take a pointer to the 'struct vfsconf' as its arg2 value. This avoids concerns about running out of bits, etc. For this you would want to change prison_check_vfs() to take a pointer to 'struct vfsconf' instead of the name.

Mar 13 2018, 7:13 PM
jamie added inline comments to D14681: Dynamically add jail-enabled filesystems.
Mar 13 2018, 6:31 PM
jamie accepted D14683: Add a "jail" keyword to list the name of a jail rather than its ID..
Mar 13 2018, 6:25 PM
jamie created D14681: Dynamically add jail-enabled filesystems.
Mar 13 2018, 3:58 PM

Mar 10 2018

jamie committed rS330743: Don't warn when the "hostname" rc variable is unset, but the hostname.
Don't warn when the "hostname" rc variable is unset, but the hostname
Mar 10 2018, 8:13 PM

Feb 28 2018

jamie accepted D14535: rc.d/jail: avoid misinterpreting expr arguments.
Feb 28 2018, 5:06 PM

Nov 13 2017

jamie committed rS325783: MFC r297935:.
MFC r297935:
Nov 13 2017, 11:21 PM

Oct 29 2017

jamie accepted D9649: ifconfig(8) and route(8) should be able to manage vnet configurations from prison0.
Oct 29 2017, 2:54 PM · network

Oct 27 2017

jamie added a comment to D9649: ifconfig(8) and route(8) should be able to manage vnet configurations from prison0.

I'm good with it - I was just waiting for suggested changed to make it in.

Oct 27 2017, 2:47 PM · network

Oct 25 2017

jamie added a comment to D12789: Add support for cpuset to jail.conf.

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.

Oct 25 2017, 4:49 PM
jamie added a comment to D12789: Add support for cpuset to jail.conf.

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.

Oct 25 2017, 4:48 PM

Jul 31 2017

jamie committed rS321796: Add myself to the birthday calendar..
Add myself to the birthday calendar.
Jul 31 2017, 3:29 PM

Jul 3 2017

jamie accepted D11451: Extend pr_allow flags to 64bit.
Jul 3 2017, 8:53 PM

Jul 2 2017

jamie added a comment to D11451: Extend pr_allow flags to 64bit.

It has only exhausted 16 bits, no? I would think if you added the flag but left pr_allow as plain "unsigned" your kernel would still work.

Jul 2 2017, 6:49 PM

May 17 2017

jamie added a comment to D10770: Add a security.bsd.see_jail_proc.

@jamie Does the updated patch look like what you had in mind?

May 17 2017, 10:38 PM
jamie added a comment to D10770: Add a security.bsd.see_jail_proc.

Is it a bug in cr_canseeotheruids() and cr_canseeothergids() that they don't hide processes in jails that happen to be the same uid/gid (but aren't the same user because they're in a jail)?

May 17 2017, 5:22 PM
jamie added a comment to D10770: Add a security.bsd.see_jail_proc.

Wait, I'm confused. If that's sufficient, then why am I seeing (as a non privileged user on the host) processes running in jails when I have security.bsd.see_other_gids and security.bsd.see_other_uids set to 0 (the processes happen to be the same UID as my user but aren't the same user)?

May 17 2017, 5:10 PM
jamie added a comment to D10770: Add a security.bsd.see_jail_proc.

No, cr_seeotheruids() and c r_seeothergids() are fine as is. Since prison_check() comes before everything else, those don't need to worry about th prison situation. You still need the new sysctl though, for the originally identified reason.

May 17 2017, 4:48 PM
jamie added a comment to D10770: Add a security.bsd.see_jail_proc.

prison_check() is required in all cases, because it covers jails that can never be seen, i.e. if you're trying to see processes in a parent jail, or a jail is trying to see the base system. The reason prison_check() does the equality test is because prison_ischild() checks for a "<" kind of relationship when we want a "<=" check.

May 17 2017, 4:39 PM
jamie added a comment to D10770: Add a security.bsd.see_jail_proc.

jailed() isn't the right test. It handles someone on the host system looking at jailed users' processes, but doesn't handle the sub-jail case. If a user in p1 is looking at processes, he shouldn't see anything from p2 which is a jail under p1. Yet, both creds will show up as "jailed".

May 17 2017, 3:52 PM

Apr 8 2017

jamie accepted D10202: Add a new parameter to restrict jails from binding to privileged ports.
Apr 8 2017, 3:25 AM

Mar 31 2017

jamie added a comment to D10202: Add a new parameter to restrict jails from binding to privileged ports.

You don't need the KP_ALLOW_RESERVED_PORTS in jailp.h and config.c - you can just leave these files untouched. The KP_* defines are for parameters that are internally referenced somewhere within jail(8). That includes most of the allow.* parameters, only to handle back-compatibility with the security.jail.*_allowed sysctls.

Mar 31 2017, 2:42 AM

Mar 30 2017

jamie committed rS316193: MFC r316022,r316023:.
MFC r316022,r316023:
Mar 30 2017, 1:38 AM
jamie committed rS316192: MFC r316022,r316023:.
MFC r316022,r316023:
Mar 30 2017, 1:38 AM

Mar 27 2017

jamie committed rS316023: Same as r316022 (Fix hexadecimal escape codes in jail.conf(5)),.
Same as r316022 (Fix hexadecimal escape codes in jail.conf(5)),
Mar 27 2017, 1:38 PM
jamie committed rS316022: Fix hexadecimal escape codes in jail.conf(5)..
Fix hexadecimal escape codes in jail.conf(5).
Mar 27 2017, 1:28 PM

Mar 3 2017

jamie added a comment to D9649: ifconfig(8) and route(8) should be able to manage vnet configurations from prison0.

Rather than the "jail does not exist" error message for a jid of -1, you can use jail_errmsg which is already set by jail_getid. See setifvnet() in ifconfig.c for an example. And while the second "jail does not exist" message for EINVAL is admirably complete, it seems a touch overkill for the race diction of a jail going away between the "-j" parsing and the jail_attach().

Mar 3 2017, 2:15 AM · network
jamie added a comment to D9649: ifconfig(8) and route(8) should be able to manage vnet configurations from prison0.
In D9649#203147, @mjg wrote:

I think the jail_attach interface is fundamentally unsuitable for this purpose. The problem is the process appears in the jail.

Instead, there should be a way to restrict your actions to ones only affecting the target jail while not entering it and alter back away from it after you are done. This could be accomplished by providing e.g. jail-based file descriptors. You obtain jail fds for jails you want to modify and for the jail you are in right now so that you can go back.

Mar 3 2017, 2:10 AM · network

Dec 24 2016

jamie committed rS310530: Improve IP address list representation in libxo output..
Improve IP address list representation in libxo output.
Dec 24 2016, 11:51 PM
jamie closed D8766: jls(8) libxo improved IP address list output by committing rS310530: Improve IP address list representation in libxo output..
Dec 24 2016, 11:51 PM

Dec 22 2016

jamie added a comment to D8766: jls(8) libxo improved IP address list output.

I was going to commit, but noticed one thing: the "{ql:ipv4_addr}" (or ipv6_addr) in emit_ip_addr_list's emit_str doesn't ever get reflected in the output (which I think it proper). Does it need to be there at all, or am I missing something? I admit to not being close to a libxo expert.

Dec 22 2016, 7:03 PM

Dec 20 2016

jamie added a comment to D8766: jls(8) libxo improved IP address list output.

Suggestion for a commit message. Is this too long?
...

Dec 20 2016, 9:36 PM

Dec 18 2016

jamie accepted D8766: jls(8) libxo improved IP address list output.
Dec 18 2016, 11:33 PM

Dec 16 2016

jamie added a comment to D8766: jls(8) libxo improved IP address list output.

emit_ip_addr() is always called surrounded by calls to xo_open_list and xo_close_list. It seems cleaner to have those calls as part of emit_ip_addr() istself. It would take an extra parameter of the name that xo_open and xo_close need, but then fewer lines of code overall.

Dec 16 2016, 7:57 PM
jamie added a comment to D8766: jls(8) libxo improved IP address list output.

I don't think the man page needs to change for this. While it's different than the output used to look, there's no more reason to note such specifics of the libxo output format there than there was before.

Dec 16 2016, 7:53 PM

Oct 2 2016

jamie accepted D8096: Fix libjail reached latest sysctl entry.

Sorry I got sidetracked by that bit, and that it was the only thing I had to say at the time - I just wasn't available to follow up today. Yeah, the actual substantial part of the change looks good.

Oct 2 2016, 4:21 AM

Oct 1 2016

jamie added a comment to D8096: Fix libjail reached latest sysctl entry.

Surely those blackslashes at the ends of the lines shouldn't be there?

Oct 1 2016, 6:19 AM

Jul 17 2016

jamie committed rS302959: MFC r302857:.
MFC r302857:
Jul 17 2016, 2:16 PM
jamie committed rS302958: MFC r302856:.
MFC r302856:
Jul 17 2016, 2:15 PM
jamie committed rS302956: MFC r302855:.
MFC r302855:
Jul 17 2016, 2:12 PM
jamie committed rS302955: MFC r302857:.
MFC r302857:
Jul 17 2016, 2:08 PM
jamie committed rS302954: MFC r302856:.
MFC r302856:
Jul 17 2016, 2:06 PM
jamie committed rS302953: MFC r302855:.
MFC r302855:
Jul 17 2016, 2:05 PM

Jul 14 2016

jamie committed rS302857: Start jails non-parallel if jail_parallel_start is NO. This was true.
Start jails non-parallel if jail_parallel_start is NO. This was true
Jul 14 2016, 8:17 PM
jamie committed rS302856: Fix up the order in which jail creation processes are run, to preserve.
Fix up the order in which jail creation processes are run, to preserve
Jul 14 2016, 8:16 PM
jamie committed rS302855: Wait for jails to complete startup if jail_parallel_start is YES,.
Wait for jails to complete startup if jail_parallel_start is YES,
Jul 14 2016, 7:52 PM

Jun 15 2016

jamie committed rS301910: MFC r301764:.
MFC r301764:
Jun 15 2016, 2:00 AM
jamie committed rS301909: MFC r301760:.
MFC r301760:
Jun 15 2016, 1:59 AM
jamie committed rS301908: MFC r301758:.
MFC r301758:
Jun 15 2016, 1:57 AM
jamie committed rS301907: MFC r301745:.
MFC r301745:
Jun 15 2016, 1:56 AM
jamie committed rS301906: MFC r301737:.
MFC r301737:
Jun 15 2016, 1:54 AM
jamie committed rS301905: MFC r300983:.
MFC r300983:
Jun 15 2016, 1:49 AM

Jun 9 2016

jamie committed rS301764: Fix a vnode leak when giving a child jail a too-long path when.
Fix a vnode leak when giving a child jail a too-long path when
Jun 9 2016, 9:59 PM
jamie committed rS301760: Re-order some jail parameter reading to prevent a vnode leak..
Re-order some jail parameter reading to prevent a vnode leak.
Jun 9 2016, 8:43 PM
jamie committed rS301758: Clean up some logic in jail error messages, replacing a missing test and.
Clean up some logic in jail error messages, replacing a missing test and
Jun 9 2016, 8:40 PM
jamie committed rS301745: Make sure the OSD methods for jail set and remove can't run concurrently,.
Make sure the OSD methods for jail set and remove can't run concurrently,
Jun 9 2016, 4:42 PM
jamie committed rS301737: Remove a comment that was part of copied code, and is misleading in.
Remove a comment that was part of copied code, and is misleading in
Jun 9 2016, 3:34 PM

May 30 2016

jamie committed rS300983: Mark jail(2), and the sysctls that it (and only it) uses as deprecated..
Mark jail(2), and the sysctls that it (and only it) uses as deprecated.
May 30 2016, 5:21 AM

May 1 2016

jamie committed rS298889: MFC r298888: typo.
MFC r298888: typo
May 1 2016, 4:50 PM
jamie committed rS298888: typo.
typo
May 1 2016, 4:48 PM

Apr 30 2016

jamie committed rS298863: Clarify when happens when there is a "depend" parameter in jail.conf,.
Clarify when happens when there is a "depend" parameter in jail.conf,
Apr 30 2016, 9:27 PM
jamie committed rS298852: MFC r295471:.
MFC r295471:
Apr 30 2016, 3:06 PM
jamie committed rS298835: MFC r298584:.
MFC r298584:
Apr 30 2016, 4:02 AM
jamie committed rS298834: MFC r297367:.
MFC r297367:
Apr 30 2016, 4:01 AM
jamie committed rS298833: MFC r298565:.
MFC r298565:
Apr 30 2016, 3:19 AM
jamie committed rS298832: MFC r298564:.
MFC r298564:
Apr 30 2016, 3:05 AM

Apr 28 2016

jamie committed rS298729: MFC r298562:.
MFC r298562:
Apr 28 2016, 1:41 AM
jamie committed rS298728: MFC r298516:.
MFC r298516:
Apr 28 2016, 1:31 AM

Apr 27 2016

jamie committed rS298683: Delay revmoing the last jail reference in prison_proc_free, and instead.
Delay revmoing the last jail reference in prison_proc_free, and instead
Apr 27 2016, 2:25 AM

Apr 26 2016

jamie committed rS298668: Use crcopysafe in jail_attach..
Use crcopysafe in jail_attach.
Apr 26 2016, 9:19 PM
jamie committed rS298656: Redo the changes to the SYSV IPC sysctl functions from r298585, so they.
Redo the changes to the SYSV IPC sysctl functions from r298585, so they
Apr 26 2016, 6:18 PM

Apr 25 2016

jamie committed rS298597: Fix the logic in r298585: shm_prison_cansee returns an errno, so is.
Fix the logic in r298585: shm_prison_cansee returns an errno, so is
Apr 25 2016, 10:30 PM
jamie committed rS298585: Encapsulate SYSV IPC objects in jails. Define per-module parameters.
Encapsulate SYSV IPC objects in jails. Define per-module parameters
Apr 25 2016, 5:07 PM
jamie committed rS298584: Note the existence of module-specific jail paramters, starting with the.
Note the existence of module-specific jail paramters, starting with the
Apr 25 2016, 5:01 PM
jamie committed rS298573: linux_map_osrel doesn't need to be checked in linux_prison_set,.
linux_map_osrel doesn't need to be checked in linux_prison_set,
Apr 25 2016, 6:08 AM
jamie committed rS298567: Use the new PR_METHOD_REMOVE to clean up jail handling in POSIX.
Use the new PR_METHOD_REMOVE to clean up jail handling in POSIX
Apr 25 2016, 4:37 AM
jamie committed rS298566: Pass the current/new jail to PR_METHOD_CHECK, which pushes the call.
Pass the current/new jail to PR_METHOD_CHECK, which pushes the call
Apr 25 2016, 4:28 AM
jamie committed rS298565: Add a new jail OSD method, PR_METHOD_REMOVE. It's called when a jail is.
Add a new jail OSD method, PR_METHOD_REMOVE. It's called when a jail is
Apr 25 2016, 4:24 AM
jamie committed rS298564: Remove the PR_REMOVE flag, which was meant as a temporary marker for.
Remove the PR_REMOVE flag, which was meant as a temporary marker for
Apr 25 2016, 3:58 AM
jamie committed rS298562: Make jail(8) interpret escape codes in fstab the same as getfsent(3)..
Make jail(8) interpret escape codes in fstab the same as getfsent(3).
Apr 25 2016, 3:25 AM

Apr 23 2016

jamie committed rS298516: Don't remove the /var/run/jail_name.id file if a jail fails to start..
Don't remove the /var/run/jail_name.id file if a jail fails to start.
Apr 23 2016, 4:23 PM

Apr 14 2016

jamie committed rS297976: Clean up some style(9) violations..
Clean up some style(9) violations.
Apr 14 2016, 5:16 PM

Apr 13 2016

jamie committed rS297936: Separate POSIX mqueue objects in jails; actually, separate them by the.
Separate POSIX mqueue objects in jails; actually, separate them by the
Apr 13 2016, 8:16 PM
jamie committed rS297935: Separate POSIX sem/shm objects in jails, by prepending the jail's path.
Separate POSIX sem/shm objects in jails, by prepending the jail's path
Apr 13 2016, 8:14 PM