Page MenuHomeFreeBSD

capsicumUmbrella
ActivePublic

Recent Activity

Oct 6 2023

oshogbo added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

Hello Jake,

Oct 6 2023, 7:27 AM · capsicum
theraven added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

I created this patch to make the Capsicumization experience less intimidating for inexperienced developers. Both David and Mariusz may not be the target audience for this change

Oct 6 2023, 7:04 AM · capsicum

Oct 5 2023

jfree added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

I created this patch to make the Capsicumization experience less intimidating for inexperienced developers. Both David and Mariusz may not be the target audience for this change because they already know how to extract the information that the tracing provides. Developers that are unfamiliar with Capsicum's semantics could use this tracing mode to easily determine why their program is not working in capability mode. I think it provides a solid starting point so new developers don't get lost and discouraged.

Oct 5 2023, 11:50 PM · capsicum

Oct 4 2023

theraven added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

It's doable in principle, but in practice dtrace's inability to resolve backtraces in the face of fork/exec makes it mostly unusable

Oct 4 2023, 3:44 PM · capsicum
markj added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

Are these events exposed to DTrace? When sandboxing, the thing I really want is a stack trace in userspace at the point where the violation happened. If so, it would be great to include a script that logged them. Ideally with an option of an explicit start marker so you can put in a fake cap_enter and be told what you still need to fix.

Oct 4 2023, 2:57 PM · capsicum

Sep 29 2023

theraven added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

Are these events exposed to DTrace? When sandboxing, the thing I really want is a stack trace in userspace at the point where the violation happened. If so, it would be great to include a script that logged them. Ideally with an option of an explicit start marker so you can put in a fake cap_enter and be told what you still need to fix.

Sep 29 2023, 6:55 AM · capsicum

Sep 28 2023

oshogbo added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

Ah, ok I thought it was printed by default.
Then I don't think I have any complaints through the idea.

Sep 28 2023, 7:47 PM · capsicum
markj added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

If I understand correctly, for application like:

localtime();
open();
cap_enter()
openat()

The first two operations will always cause ktrace to report insufficient capabilities. Which is a false-postive statement, and will be misleading for "normal" users.

Sep 28 2023, 7:39 PM · capsicum
oshogbo added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

If I understand correctly, for application like:

localtime();
open();
cap_enter()
openat()
Sep 28 2023, 7:31 PM · capsicum
markj added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

To summarize the patch very briefly, this lets you ktrace an application that does not run in capability mode, and ktrace will log all events which would have triggered a Capsicum violation.

I haven't looked into the code, to be honest. However, I don't see a real application for this approach, or maybe I misread how this is supposed to work.
Is this a tool for improving debugging sandboxed applications or sandboxing new applications?

Sep 28 2023, 6:45 PM · capsicum
jfree added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

Again, maybe I just need some more context to understand the reasoning behind this change.

Sep 28 2023, 6:39 PM · capsicum
oshogbo added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

To summarize the patch very briefly, this lets you ktrace an application that does not run in capability mode, and ktrace will log all events which would have triggered a Capsicum violation.

Sep 28 2023, 5:38 PM · capsicum
markj added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

To summarize the patch very briefly, this lets you ktrace an application that does not run in capability mode, and ktrace will log all events which would have triggered a Capsicum violation.

So this traces the system calls that are not on the allowed-in-cap-mode list?

Sep 28 2023, 5:06 PM · capsicum
theraven added a comment to D40676: ktrace: Record detailed ECAPMODE violations.

To summarize the patch very briefly, this lets you ktrace an application that does not run in capability mode, and ktrace will log all events which would have triggered a Capsicum violation.

Sep 28 2023, 4:54 PM · capsicum
markj updated subscribers of D40676: ktrace: Record detailed ECAPMODE violations.

Overall this looks good to me. I wonder if @emaste, @oshogbo or @theraven have any thoughts on it? To summarize the patch very briefly, this lets you ktrace an application that does not run in capability mode, and ktrace will log all events which would have triggered a Capsicum violation.

Sep 28 2023, 4:45 PM · capsicum
markj added inline comments to D40680: ktrace: Record vfs violations with KTR_CAPFAIL.
Sep 28 2023, 4:42 PM · capsicum
markj accepted D40678: ktrace: Record syscall violations with KTR_CAPFAIL.
Sep 28 2023, 4:24 PM · capsicum
markj added inline comments to D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.
Sep 28 2023, 4:20 PM · capsicum
markj accepted D40679: ktrace: Record signal violations with KTR_CAPFAIL.
Sep 28 2023, 4:15 PM · capsicum
markj accepted D40681: ktrace: Record socket violations with KTR_CAPFAIL.
Sep 28 2023, 4:14 PM · capsicum

Jul 28 2023

jfree updated the diff for D40682: tests: Add ktrace capability violation test cases.

Fix formatting issue in license text

Jul 28 2023, 4:07 PM · capsicum

Jun 20 2023

jfree updated the diff for D40682: tests: Add ktrace capability violation test cases.

Use cap_svflags instead of cap_flags when determining kernel ABI with syscallabi().

Jun 20 2023, 10:40 PM · capsicum
jfree updated the diff for D40680: ktrace: Record vfs violations with KTR_CAPFAIL.

Change NI_LCF_STRICTRELATIVE to NI_LCF_STRICTREL where applicable.

Jun 20 2023, 10:19 PM · capsicum
jfree requested review of D40682: tests: Add ktrace capability violation test cases.
Jun 20 2023, 10:10 PM · capsicum
jfree requested review of D40681: ktrace: Record socket violations with KTR_CAPFAIL.
Jun 20 2023, 10:09 PM · capsicum
jfree requested review of D40680: ktrace: Record vfs violations with KTR_CAPFAIL.
Jun 20 2023, 10:08 PM · capsicum
jfree added a project to D40678: ktrace: Record syscall violations with KTR_CAPFAIL: capsicum.
Jun 20 2023, 10:07 PM · capsicum
jfree requested review of D40679: ktrace: Record signal violations with KTR_CAPFAIL.
Jun 20 2023, 10:07 PM · capsicum
jfree requested review of D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.
Jun 20 2023, 10:04 PM · capsicum
jfree requested review of D40676: ktrace: Record detailed ECAPMODE violations.
Jun 20 2023, 10:03 PM · capsicum

Apr 28 2023

corvink closed D38860: bhyve: Enable Capsicum for snapshots.
Apr 28 2023, 7:07 AM · capsicum, bhyve

Apr 26 2023

def added a watcher for capsicum: def.
Apr 26 2023, 5:05 PM
def removed a member for capsicum: def.
Apr 26 2023, 5:05 PM
def added a member for capsicum: def.
Apr 26 2023, 5:04 PM

Mar 30 2023

jfree added inline comments to D39171: readpassphrase: Add readpassphraseat() function.
Mar 30 2023, 11:23 PM · capsicum
jfree updated the diff for D39171: readpassphrase: Add readpassphraseat() function.

Use AT_STDIN instead of STDIN_FILENO to force read from stdin in readpassphraseat().

Mar 30 2023, 11:15 PM · capsicum

Mar 27 2023

corvink accepted D38860: bhyve: Enable Capsicum for snapshots.
Mar 27 2023, 11:13 AM · capsicum, bhyve

Mar 21 2023

markj added a comment to D39009: unzip: Capsicumize it.

The diff looks good.

Mar 21 2023, 6:41 PM · capsicum
markj added inline comments to D39171: readpassphrase: Add readpassphraseat() function.
Mar 21 2023, 4:41 PM · capsicum

Mar 19 2023

jfree updated the diff for D39009: unzip: Capsicumize it.
  • cdfd is no longer a global variable. Instead, it is passed locally per function call.
  • Open _PATH_TTY, limit its rights, and use readpassphraseat() instead of readpassphrase().
  • Limit stdio instead of just stdin.
Mar 19 2023, 6:01 AM · capsicum
jfree requested review of D39171: readpassphrase: Add readpassphraseat() function.
Mar 19 2023, 4:36 AM · capsicum

Mar 13 2023

markj added a comment to D39009: unzip: Capsicumize it.

This looks good! Three comments:

  • I don't like that cdfd is a global variable. I'd rather see it plumbed everywhere that we pass a path, even though that's kind of onerous.

I am curious why cdfd would be better suited as a local variable? Namespace pollution doesn't seem to be an issue in a small userspace program and passing it would just add one extra argument to the stack for every function call. Is the idea to isolate its scope?

Mar 13 2023, 5:10 PM · capsicum
jfree added a comment to D39009: unzip: Capsicumize it.

This looks good! Three comments:

  • I don't like that cdfd is a global variable. I'd rather see it plumbed everywhere that we pass a path, even though that's kind of onerous.
Mar 13 2023, 4:53 PM · capsicum
markj added a comment to D39009: unzip: Capsicumize it.

This looks good! Three comments:

  • I don't like that cdfd is a global variable. I'd rather see it plumbed everywhere that we pass a path, even though that's kind of onerous.
  • I think readpassphrase() does not quite work in capability mode. See the implementation in lib/libc/gen/readpassphrase.c - it opens /dev/tty. It does have a fallback path, but I'm not sure how well that works. Could you please try writing a little standalone program that enters capability mode and tries to use readpassphrase()? Depending on how that goes, we may want to add a new variant of that function which takes fds from the caller.
  • Have you tried testing with kern.trap_enotcap set to 1? That'll help catch any system calls that might be silently failing because we're in capability mode.
Mar 13 2023, 2:41 PM · capsicum

Mar 11 2023

jfree updated the diff for D39009: unzip: Capsicumize it.

Open current directory, enter capability mode, then use *at() syscalls to extract archive files.

Mar 11 2023, 1:27 AM · capsicum

Mar 10 2023

markj added inline comments to D39009: unzip: Capsicumize it.
Mar 10 2023, 3:42 PM · capsicum

Mar 9 2023

jfree updated the diff for D39009: unzip: Capsicumize it.

Alter function names and comments for clarity

Mar 9 2023, 10:38 PM · capsicum
jfree requested review of D39009: unzip: Capsicumize it.
Mar 9 2023, 10:24 PM · capsicum
gusev.vitaliy_gmail.com updated the diff for D38860: bhyve: Enable Capsicum for snapshots.

Rebased

Mar 9 2023, 2:52 PM · capsicum, bhyve
gusev.vitaliy_gmail.com added a comment to D38860: bhyve: Enable Capsicum for snapshots.
In D38860#887537, @rew wrote:
In D38860#887381, @rew wrote:

https://reviews.freebsd.org/D38858 also needs to be addressed before this patch is committed.

I've dropped my request for changes in D38858 - there's nothing blocking this review from being landed.

Mar 9 2023, 2:51 PM · capsicum, bhyve