Oct 6 2023
Hello Jake,
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 5 2023
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 4 2023
It's doable in principle, but in practice dtrace's inability to resolve backtraces in the face of fork/exec makes it mostly unusable
Sep 29 2023
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 28 2023
Ah, ok I thought it was printed by default.
Then I don't think I have any complaints through the idea.
If I understand correctly, for application like:
localtime(); open(); cap_enter() openat()
Again, maybe I just need some more context to understand the reasoning behind this change.
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.
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.
Jul 28 2023
Fix formatting issue in license text
Jun 20 2023
Use cap_svflags instead of cap_flags when determining kernel ABI with syscallabi().
Change NI_LCF_STRICTRELATIVE to NI_LCF_STRICTREL where applicable.
Apr 28 2023
Apr 26 2023
Mar 30 2023
Use AT_STDIN instead of STDIN_FILENO to force read from stdin in readpassphraseat().
Mar 27 2023
Mar 21 2023
The diff looks good.
Mar 19 2023
- 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 13 2023
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 11 2023
Open current directory, enter capability mode, then use *at() syscalls to extract archive files.
Mar 10 2023
Mar 9 2023
Alter function names and comments for clarity
Rebased