Page MenuHomeFreeBSD

beep: Capsicumize
ClosedPublic

Authored by emaste on Jun 5 2025, 11:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 21, 8:03 AM
Unknown Object (File)
Sat, Oct 18, 2:01 AM
Unknown Object (File)
Sun, Oct 12, 12:32 PM
Unknown Object (File)
Sun, Oct 12, 1:36 AM
Unknown Object (File)
Sun, Oct 12, 1:36 AM
Unknown Object (File)
Sun, Oct 12, 1:36 AM
Unknown Object (File)
Sat, Oct 11, 4:03 PM
Unknown Object (File)
Thu, Oct 9, 10:04 AM

Details

Summary

check caph_enter() failure

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

What is the rationale behind this change?

What is the rationale behind this change?

It is unlikely that beep will be used in a context where sandboxing would be valuable but it is a simple demonstration of a capability sandbox and is easy/low-cost to do.

markj added inline comments.
usr.bin/beep/beep.c
208

caph_enter() still needs error checking.

It's a nice example of how easy example how to use Capsicum by opening all resources before entering capability mode, but would better to call cap_enter() instead of caph_enter()?

emaste edited the summary of this revision. (Show Details)

better to call cap_enter() instead of caph_enter()?

caph_enter is a very small wrapper that just ignores ENOSYS in case it's running on a kernel compiled without options CAPABILITY_MODE. If we remove that as an option we could stop doing this

This revision is now accepted and ready to land.Jun 17 2025, 6:11 PM
This revision was automatically updated to reflect the committed changes.