Page MenuHomeFreeBSD
Feed Advanced Search

Nov 17 2020

bdrewery added a comment to D17128: [sshd 7.8p1] avoid to violate capability mode.
In D17128#371823, @des wrote:

I would strongly recommend submitting the sshbuf_{get,put,free}_passwd() part of this patch upstream.

Nov 17 2020, 2:22 AM · capsicum

Nov 16 2020

freqlabs updated the diff for D24832: libcasper: Create a minimal cap_netdb service.
Nov 16 2020, 1:12 AM · capsicum

Oct 26 2020

oshogbo added a comment to D24832: libcasper: Create a minimal cap_netdb service.

I would prefer to commit this version. Sorry for me not responding for a while.

Oct 26 2020, 2:56 PM · capsicum

Oct 25 2020

freqlabs abandoned D24832: libcasper: Create a minimal cap_netdb service.
Oct 25 2020, 10:39 PM · capsicum

Oct 22 2020

yzhong_freebsdfoundation.org updated the diff for D24327: Add new casper execution service.

Added some simple tests, and made changes according to feedback. The biggest change is the addition of cap_exec_t structures, which behave very similarly to fileargs_t structures in cap_fileargs. Now there is no global state on the user's side, and you can now open multiple cap_exec services without issue.

Oct 22 2020, 3:51 PM · capsicum
dch added a watcher for capsicum: dch.
Oct 22 2020, 8:38 AM

Oct 21 2020

markj added inline comments to D24327: Add new casper execution service.
Oct 21 2020, 7:12 PM · capsicum

Oct 20 2020

yzhong_freebsdfoundation.org added inline comments to D24327: Add new casper execution service.
Oct 20 2020, 5:41 PM · capsicum

Oct 19 2020

yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

Yes, that makes sense.

Oct 19 2020, 5:36 PM · capsicum
tig_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

From my understanding, doing work in the user interface functions is the same as doing work in user program, as they are the same process. It won't be allowed if program is in cap mode.

I understand what you mean. That's why I used pdfork - having the process descriptor lets me wait for the program even in Capability mode. All the current functionality works, so I'd prefer to keep things as it is unless we want the service to do more.

Oct 19 2020, 5:34 PM · capsicum
yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.
Oct 19 2020, 5:26 PM · capsicum
tig_freebsdfoundation.org added inline comments to D24327: Add new casper execution service.
Oct 19 2020, 5:23 PM · capsicum
yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

From my understanding, doing work in the user interface functions is the same as doing work in user program, as they are the same process. It won't be allowed if program is in cap mode.

I understand what you mean. That's why I used pdfork - having the process descriptor lets me wait for the program even in Capability mode. All the current functionality works, so I'd prefer to keep things as it is unless we want the service to do more.

Oct 19 2020, 5:20 PM · capsicum
oshogbo added a comment to D24327: Add new casper execution service.

From my understanding, doing work in the user interface functions is the same as doing work in user program, as they are the same process. It won't be allowed if program is in cap mode.

Thats right, cap_exec_init, cap_exec_open, cap_exec_close are done potentialy in the sandboxed process.

Oct 19 2020, 5:20 PM · capsicum
tig_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

Doing the work on the user interface side was a conscious decision on my part. What are the disadvantages of doing it this way? And yes, I do plan to write tests.

From my understanding, doing work in the user interface functions is the same as doing work in user program, as they are the same process. It won't be allowed if program is in cap mode.
exec_command is called by Casper which is a different process, so doing work there is desirable.
It's the pattern I've seen from other Casper services.
I could be wrong though, would appreciate if someone could confirm.

Oct 19 2020, 5:17 PM · capsicum
oshogbo added inline comments to D24327: Add new casper execution service.
Oct 19 2020, 5:13 PM · capsicum
oshogbo added a comment to D24327: Add new casper execution service.

I was mistaken we need service like this, we just need to work a little bit more on it.

Oct 19 2020, 5:12 PM · capsicum
tig_freebsdfoundation.org added inline comments to D24327: Add new casper execution service.
Oct 19 2020, 5:08 PM · capsicum
yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

Doing the work on the user interface side was a conscious decision on my part. What are the disadvantages of doing it this way? And yes, I do plan to write tests.

Oct 19 2020, 5:06 PM · capsicum
tig_freebsdfoundation.org added inline comments to D24327: Add new casper execution service.
Oct 19 2020, 5:04 PM · capsicum
tig_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

Note that in Casper service user interface and Casper backend are separate processes. Casper does all the work and the user interface simply passes and receives parameters.
One issue I noticed is that the code is doing the actual work (closing fds) in the user interface commands cap_exec_open() and cap_exec_close(), this should be done from exec_command(), perhaps via functions cap_exec_command_open() and cap_exec_command_close(). cap_fileargs.c has a good example of how to do this.
Do you plan to add some test cases?

Oct 19 2020, 5:03 PM · capsicum
yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

Would such an approach work if I don't have the full path of the program to be executed?

Oct 19 2020, 4:41 PM · capsicum
oshogbo added a comment to D24327: Add new casper execution service.

Ou but I guess you wan't your new process not being in sandbox, right?

Oct 19 2020, 4:25 PM · capsicum
oshogbo added a comment to D24327: Add new casper execution service.

Please don't take this an a criticisms I just would like to know the advantages of this approach.

Oct 19 2020, 4:24 PM · capsicum
yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

I wonder we can't just use fileargs and fexecve?

Oct 19 2020, 4:12 PM · capsicum
yzhong_freebsdfoundation.org added a comment to D24327: Add new casper execution service.

Thinking about it more, the change to FILE* makes it somewhat unintuitive (or impossible?) to execute commands that you neither read from nor write to. Initially, I made the change because I was doing:
1 - get a file descriptor from cap_exec_open
2 - call fdopen() on it to get a FILE* to work with
3 - later, close the file descriptor with cap_exec_close
But at this point I'm left with a 'dangling' FILE*. I can't call fclose on it as it gives me an unsurprising "bad file descriptor" error. So at this point I felt that it was more sensible for cap_exec to work with FILE*s, since it matches popen in any case. But now, I see that returning a FILE* doesn't make sense in all cases.

Oct 19 2020, 4:07 PM · capsicum
oshogbo added a comment to D24327: Add new casper execution service.

I wonder we can't just use fileargs and fexecve?

Oct 19 2020, 3:56 PM · capsicum
yzhong_freebsdfoundation.org updated the diff for D24327: Add new casper execution service.

In the process of Capsicumizing sort(1), I found that I couldn't properly close the file descriptors that came from this service. It used to return the file descriptor of a FILE* opened via popen(3). This meant that the user can't use pclose to close the file descriptor they receive; pclose expects the same FILE * that popen returned, which the user can't recover. Pclose is responsible for waiting until the opened process ends, and if it isn't called, the user will get concurrency issues (like writing to a file, "closing" it, and then trying to read from it before the write actually finishes).

Oct 19 2020, 3:44 PM · capsicum
yzhong_freebsdfoundation.org retitled D24327: Add new casper execution service from Add new casper execuion service to Add new casper execution service.
Oct 19 2020, 3:08 PM · capsicum
yzhong_freebsdfoundation.org commandeered D24327: Add new casper execution service.
Oct 19 2020, 3:05 PM · capsicum

Sep 8 2020

emaste updated subscribers of D24327: Add new casper execution service.
Sep 8 2020, 4:23 PM · capsicum

Sep 6 2020

oshogbo added inline comments to D26236: Capsicumize file(1).
Sep 6 2020, 2:14 PM · capsicum
oshogbo added inline comments to D25905: Capsicumize fsck_msdosfs.
Sep 6 2020, 2:11 PM · capsicum
oshogbo added inline comments to D25917: Capsicumize fsdb.
Sep 6 2020, 2:10 PM · capsicum
oshogbo added inline comments to D26094: Capsicumize fsck_ffs.
Sep 6 2020, 2:09 PM · capsicum
oshogbo closed D25604: Capsicumize traceroute6.
Sep 6 2020, 2:04 PM · capsicum

Aug 30 2020

delphij added a comment to D26236: Capsicumize file(1).

Please be sure to talk with upstream (Christos) before making changes.

Aug 30 2020, 10:07 PM · capsicum
delphij added a reviewer for D26236: Capsicumize file(1): christos_netbsd.org.
Aug 30 2020, 10:06 PM · capsicum
shubh requested review of D26236: Capsicumize file(1).
Aug 30 2020, 4:48 PM · capsicum

Aug 18 2020

shubh updated the diff for D25917: Capsicumize fsdb.
  • Fixed indents
  • Added 2 comments
Aug 18 2020, 12:54 AM · capsicum
shubh requested review of D26094: Capsicumize fsck_ffs.
Aug 18 2020, 12:43 AM · capsicum

Aug 17 2020

shubh updated the diff for D25905: Capsicumize fsck_msdosfs.

Minor fix

Aug 17 2020, 11:03 PM · capsicum
shubh updated the diff for D25905: Capsicumize fsck_msdosfs.
  • Code for opening the filesystem has been shifted to main.c so that different cases for HAVE_CAPSICUM could use a similar call to checkfilesys()
  • Added caph_enter_caspe() instead of caph_enter()
  • Other minor fixes
Aug 17 2020, 10:21 PM · capsicum

Aug 5 2020

markj accepted D25604: Capsicumize traceroute6.

I'll do some testing of this.

Aug 5 2020, 3:22 PM · capsicum
shubh updated the diff for D25604: Capsicumize traceroute6.
  • Removed #ifndef HAVE_GETIPNODEBYNAME block completely and added a comment near the usage of getipnodebyname()
  • Used nitems inside cap_dns_type_limit() and cap_dns_family_limit()
  • Moved the logic for opening cap_dns to a new function capdns_open()
Aug 5 2020, 2:21 AM · capsicum
shubh added inline comments to D25917: Capsicumize fsdb.
Aug 5 2020, 1:39 AM · capsicum

Aug 4 2020

markj added inline comments to D25917: Capsicumize fsdb.
Aug 4 2020, 2:27 PM · capsicum
markj accepted D25604: Capsicumize traceroute6.

This looks ok to me modulo the outstanding comments.

Aug 4 2020, 2:23 PM · capsicum
markj added inline comments to D25905: Capsicumize fsck_msdosfs.
Aug 4 2020, 2:13 PM · capsicum

Aug 3 2020

oshogbo added inline comments to D25917: Capsicumize fsdb.
Aug 3 2020, 9:24 AM · capsicum
oshogbo added inline comments to D25905: Capsicumize fsck_msdosfs.
Aug 3 2020, 9:23 AM · capsicum
shubh added inline comments to D25917: Capsicumize fsdb.
Aug 3 2020, 9:19 AM · capsicum
oshogbo added inline comments to D25917: Capsicumize fsdb.
Aug 3 2020, 9:01 AM · capsicum
oshogbo added inline comments to D25604: Capsicumize traceroute6.
Aug 3 2020, 9:00 AM · capsicum

Aug 2 2020

shubh requested review of D25917: Capsicumize fsdb.
Aug 2 2020, 12:45 AM · capsicum

Aug 1 2020

shubh updated the diff for D25905: Capsicumize fsck_msdosfs.
  • Added cap_fileargs for multiple filesystems as arguments.
  • 2 instances of cap_fileargs have been used to imitate the open() calls for different flag cases
  • Wrapped the sandboxing logic under HAVE_CAPSICUM flag
Aug 1 2020, 5:11 AM · capsicum

Jul 31 2020

markj added inline comments to D25905: Capsicumize fsck_msdosfs.
Jul 31 2020, 8:02 PM · capsicum
shubh updated the diff for D25905: Capsicumize fsck_msdosfs.
  • Minor fix to let all cases of open() calls work
Jul 31 2020, 7:15 PM · capsicum
markj added inline comments to D25905: Capsicumize fsck_msdosfs.
Jul 31 2020, 7:06 PM · capsicum
shubh updated the diff for D25905: Capsicumize fsck_msdosfs.
  • Added #ifdef HAVE_CAPSICUM
Jul 31 2020, 6:59 PM · capsicum
delphij added a comment to D25905: Capsicumize fsck_msdosfs.

Looks good to me as long as the capscium specific code were wrapped with #ifdef's as this is shared with other platforms.

Jul 31 2020, 4:16 PM · capsicum
markj added a comment to D25905: Capsicumize fsck_msdosfs.

Don't we need a makefile change as well, to set -DWITH_CASPER?

Jul 31 2020, 1:42 PM · capsicum
shubh requested review of D25905: Capsicumize fsck_msdosfs.
Jul 31 2020, 1:21 PM · capsicum

Jul 27 2020

shubh updated the diff for D25604: Capsicumize traceroute6.

Minor fixes

Jul 27 2020, 12:32 PM · capsicum
oshogbo added inline comments to D25604: Capsicumize traceroute6.
Jul 27 2020, 12:09 PM · capsicum

Jul 20 2020

shubh updated the diff for D25604: Capsicumize traceroute6.
  • Removed unnecessary ifdefs
  • Added some capsicum helper functions
Jul 20 2020, 8:55 PM · capsicum
oshogbo added inline comments to D25604: Capsicumize traceroute6.
Jul 20 2020, 7:38 AM · capsicum

Jul 17 2020

shubh updated the diff for D25604: Capsicumize traceroute6.

Updated with context and removed a bug where it didn't work with the -I flag in the fist diff

Jul 17 2020, 10:08 PM · capsicum
shubh updated the diff for D25604: Capsicumize traceroute6.
  • Added MK_CASPER check to the Makefile
  • Added WITH_CASPER defines instead of HAVE_LIBCASPER
  • Checked for errno after cap_enter() call
  • Removed cansandbox variable
Jul 17 2020, 7:50 PM · capsicum

Jul 10 2020

oshogbo added inline comments to D25604: Capsicumize traceroute6.
Jul 10 2020, 7:50 AM · capsicum
oshogbo added inline comments to D25604: Capsicumize traceroute6.
Jul 10 2020, 7:50 AM · capsicum

Jul 9 2020

shubh updated the diff for D25604: Capsicumize traceroute6.

Updated the diff with context

Jul 9 2020, 8:33 PM · capsicum
shubh requested review of D25604: Capsicumize traceroute6.
Jul 9 2020, 8:20 PM · capsicum

Jul 6 2020

markj closed D25552: kern_cpuset: allow using the explicit form of own pid/tid in capability mode.
Jul 6 2020, 4:34 PM · capsicum
markj added a comment to D25552: kern_cpuset: allow using the explicit form of own pid/tid in capability mode.
In D25552#565512, @greg_unrelenting.technology wrote:
  • these checks should really be lifted into a subroutine,

Yeah I thought about that..

Please let me know if you'd like to write patches for this, otherwise I will work on it.

Feel free to make the better version of the patch yourself, the patch review process would just be a slowdown :)

Jul 6 2020, 4:19 PM · capsicum
val_packett.cool added a comment to D25552: kern_cpuset: allow using the explicit form of own pid/tid in capability mode.
  • these checks should really be lifted into a subroutine,
Jul 6 2020, 2:36 PM · capsicum
markj accepted D25552: kern_cpuset: allow using the explicit form of own pid/tid in capability mode.

This looks ok to me. I'm happy to commit the patch as-is, but:

  • these checks should really be lifted into a subroutine,
  • cpuset_(get|set)domain() are not listed in capabilities.conf and so aren't available in capability mode at all, though clearly they should be.
Jul 6 2020, 2:27 PM · capsicum

Jul 4 2020

val_packett.cool added a reviewer for D25552: kern_cpuset: allow using the explicit form of own pid/tid in capability mode: markj.
Jul 4 2020, 11:12 AM · capsicum

Jul 2 2020

val_packett.cool requested review of D25552: kern_cpuset: allow using the explicit form of own pid/tid in capability mode.
Jul 2 2020, 8:12 PM · capsicum

May 14 2020

freqlabs added a comment to D24832: libcasper: Create a minimal cap_netdb service.

I wonder if this should be incorporated as part of cap_net (D24688) instead?

May 14 2020, 3:56 PM · capsicum
freqlabs updated the diff for D24832: libcasper: Create a minimal cap_netdb service.

Incorporate feedback

May 14 2020, 2:40 PM · capsicum
kevans added inline comments to D24832: libcasper: Create a minimal cap_netdb service.
May 14 2020, 2:33 PM · capsicum
bcr accepted D24832: libcasper: Create a minimal cap_netdb service.

OK from manpages.

May 14 2020, 8:14 AM · capsicum

May 13 2020

freqlabs requested review of D24832: libcasper: Create a minimal cap_netdb service.
May 13 2020, 10:46 PM · capsicum

Apr 21 2020

tig_freebsdfoundation.org updated the diff for D24327: Add new casper execution service.

Updated license.

Apr 21 2020, 8:14 PM · capsicum
tig_freebsdfoundation.org updated the diff for D24442: Add new casper socket service.

update license

Apr 21 2020, 8:06 PM · capsicum

Apr 16 2020

tig_freebsdfoundation.org created D24442: Add new casper socket service.
Apr 16 2020, 3:24 PM · capsicum

Apr 7 2020

tig_freebsdfoundation.org updated the summary of D24327: Add new casper execution service.
Apr 7 2020, 5:41 PM · capsicum
tig_freebsdfoundation.org created D24327: Add new casper execution service.
Apr 7 2020, 5:32 PM · capsicum

Jan 6 2020

val_packett.cool added a comment to D23043: rtld-elf: Fix loading libraries with ORIGIN flag (like LLVM) via LD_LIBRARY_PATH_FDS.

effectively ignoring the $ORIGIN at all

Jan 6 2020, 5:24 PM · capsicum
kib added a comment to D23043: rtld-elf: Fix loading libraries with ORIGIN flag (like LLVM) via LD_LIBRARY_PATH_FDS.

So lets untangle this.

Jan 6 2020, 5:17 PM · capsicum
val_packett.cool added a comment to D23043: rtld-elf: Fix loading libraries with ORIGIN flag (like LLVM) via LD_LIBRARY_PATH_FDS.
In D23043#505145, @kib wrote:

How do you define 'work' ? Show the ktrace of the test with patched rtld, I doubt that the library is loaded.

Jan 6 2020, 10:49 AM · capsicum
kib added a comment to D23043: rtld-elf: Fix loading libraries with ORIGIN flag (like LLVM) via LD_LIBRARY_PATH_FDS.

How do you define 'work' ? Show the ktrace of the test with patched rtld, I doubt that the library is loaded. Rtld never parses "#NNNN" in a path as a reference to a directory descriptor.

Jan 6 2020, 1:20 AM · capsicum

Jan 5 2020

val_packett.cool created D23043: rtld-elf: Fix loading libraries with ORIGIN flag (like LLVM) via LD_LIBRARY_PATH_FDS.
Jan 5 2020, 9:16 PM · capsicum

Dec 21 2019

cem abandoned D17056: [sshd] add wrapper function of login_getpwclass.

Superceded by D17128, committed in rS339216.

Dec 21 2019, 3:43 AM · capsicum
cem commandeered D17056: [sshd] add wrapper function of login_getpwclass.
Dec 21 2019, 3:42 AM · capsicum

Nov 27 2019

me_mko.io added a watcher for capsicum: me_mko.io.
Nov 27 2019, 12:00 PM

Jun 5 2019

oshogbo closed D20393: Adapting tail(1) to use Capsicum.
Jun 5 2019, 10:41 PM · capsicum
oshogbo accepted D20393: Adapting tail(1) to use Capsicum.
Jun 5 2019, 10:37 PM · capsicum

May 25 2019

nsultana_seas.upenn.edu added inline comments to D20393: Adapting tail(1) to use Capsicum.
May 25 2019, 8:59 PM · capsicum