Page MenuHomeFreeBSD

capsicumUmbrella
ActivePublic

Recent Activity

Sun, Apr 7

jfree closed D40682: tests: Add ktrace capability violation test cases.
Sun, Apr 7, 11:58 PM · capsicum
jfree closed D40681: ktrace: Record socket violations with KTR_CAPFAIL.
Sun, Apr 7, 11:58 PM · capsicum
jfree closed D40680: ktrace: Record namei violations with KTR_CAPFAIL.
Sun, Apr 7, 11:58 PM · capsicum
jfree closed D40679: ktrace: Record signal violations with KTR_CAPFAIL.
Sun, Apr 7, 11:58 PM · capsicum
jfree closed D40678: ktrace: Record syscall violations with KTR_CAPFAIL.
Sun, Apr 7, 11:58 PM · capsicum
jfree closed D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.
Sun, Apr 7, 11:58 PM · capsicum
jfree closed D40676: ktrace: Record detailed ECAPMODE violations.
Sun, Apr 7, 11:58 PM · capsicum

Fri, Mar 29

oshogbo accepted D40676: ktrace: Record detailed ECAPMODE violations.
Fri, Mar 29, 4:19 PM · capsicum
markj accepted D40680: ktrace: Record namei violations with KTR_CAPFAIL.
Fri, Mar 29, 3:34 PM · capsicum
markj accepted D40676: ktrace: Record detailed ECAPMODE violations.
Fri, Mar 29, 3:33 PM · capsicum

Mar 10 2024

jfree updated the diff for D40680: ktrace: Record namei violations with KTR_CAPFAIL.
  • Record *namei* violations instead of vfs. Slight wording change for clarity.
  • Rebase on main after several months
Mar 10 2024, 4:25 AM · capsicum
jfree retitled D40680: ktrace: Record namei violations with KTR_CAPFAIL from ktrace: Record vfs violations with KTR_CAPFAIL to ktrace: Record namei violations with KTR_CAPFAIL.
Mar 10 2024, 4:23 AM · capsicum
jfree updated the summary of D40682: tests: Add ktrace capability violation test cases.
Mar 10 2024, 4:21 AM · capsicum
jfree updated the diff for D40682: tests: Add ktrace capability violation test cases.
  • Rename all instances of CAPFAIL_VFS to CAPFAIL_NAMEI
  • Rebase on main after several months
Mar 10 2024, 4:21 AM · capsicum
jfree updated the summary of D40676: ktrace: Record detailed ECAPMODE violations.
Mar 10 2024, 4:15 AM · capsicum
jfree updated the diff for D40676: ktrace: Record detailed ECAPMODE violations.
  • Address Mark's comments
  • Rebase on main after several months
Mar 10 2024, 4:15 AM · capsicum
jfree added inline comments to D40676: ktrace: Record detailed ECAPMODE violations.
Mar 10 2024, 4:13 AM · capsicum

Jan 18 2024

markj accepted D40682: tests: Add ktrace capability violation test cases.
Jan 18 2024, 3:46 PM · capsicum
markj accepted D40680: ktrace: Record namei violations with KTR_CAPFAIL.
Jan 18 2024, 3:46 PM · capsicum

Jan 9 2024

jfree updated the diff for D40680: ktrace: Record namei violations with KTR_CAPFAIL.

Replace all instances of "AT_FDCWD" with "<AT_FDCWD>" when reporting a violation via ktrcapfail().

Jan 9 2024, 4:28 AM · capsicum
jfree added inline comments to D40680: ktrace: Record namei violations with KTR_CAPFAIL.
Jan 9 2024, 4:22 AM · capsicum
jfree added inline comments to D40680: ktrace: Record namei violations with KTR_CAPFAIL.
Jan 9 2024, 4:14 AM · capsicum
jfree added a comment to D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.

I would frown at that. :) It introduces hidden control flow which makes it hard to see quickly what a function does.

Consider the common case where a function allocates some memory and is supposed to free it before returning: if I'm reviewing the code and want to verify it behaves properly with respect to that free() call, it's much easier to check if I just have to look for the "return" keyword in the function.

Once in a while it's handy, but it should be avoided if possible.

Jan 9 2024, 12:52 AM · capsicum

Jan 8 2024

markj accepted D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.

Actually, scratch that. I just understood your comment and this is a better solution.

As a side note though... Is returning in macros usually frowned upon?

Jan 8 2024, 2:55 PM · capsicum

Jan 7 2024

jfree updated the diff for D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.

Actually, scratch that. I just understood your comment and this is a better solution.

Jan 7 2024, 8:24 AM · capsicum
jfree updated the diff for D40677: ktrace: Record cpuset violations with KTR_CAPFAIL.

It feels wrong to return inside of a macro, but I did not see any comments about it in style(9). This seems to be the solution that is most elegant in minimizing code duplication. Let me know your thoughts.

Jan 7 2024, 7:53 AM · capsicum

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 namei 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 namei 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