Page MenuHomeFreeBSD

Introduce caph_enter
ClosedPublic

Authored by oshogbo on Mar 1 2018, 8:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 11:34 PM
Unknown Object (File)
Fri, Mar 22, 11:34 PM
Unknown Object (File)
Fri, Mar 22, 11:34 PM
Unknown Object (File)
Fri, Mar 22, 11:34 PM
Unknown Object (File)
Thu, Mar 21, 6:13 PM
Unknown Object (File)
Fri, Mar 8, 7:37 AM
Unknown Object (File)
Jan 7 2024, 7:30 AM
Unknown Object (File)
Jan 7 2024, 7:30 AM
Subscribers

Details

Summary

The functions should made it easier to sandbox application and not force us to remember that we need to check errno on failure.
Another function is checking if casper is present. If it's not we can't enter capability mode and function is succession because sb don't want to be secure and use casper.

I wonder if we want a second function or just some flag for caph_enter?
Or maybe we don't care that we need to so often check errno on failure and caph_enter should always check if casper is present.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

caph_enter looks fine to me.

I'm not sure about the other one.

lib/libcapsicum/capsicum_helpers.h
41 ↗(On Diff #39869)

Why is it separated?

@emaste @cem Thanks for reviewing.

Other function is exactly the same with the exception that it also check if we are building with Casper.
If we are build without then we just return success without entering capability mode because we probably use some function that need Casper support.

lib/libcapsicum/capsicum_helpers.h
41 ↗(On Diff #39869)

We used that style earlier example usr.bin/kdump/kdump.c .
Its mostly because casper and libcasper sort kinda badly and libcasper must be before #include<casper/ >
I decided to use the same style we are using everywhere.

This seems sensible, but I found some small mistakes in the man page.

lib/libcapsicum/capsicum_helpers.3
66 ↗(On Diff #39869)

it returns success when the kernel is built

70 ↗(On Diff #39869)

typo: capser

73 ↗(On Diff #39869)

it returns success when the system is built

This revision is now accepted and ready to land.Apr 21 2018, 4:00 AM
This revision was automatically updated to reflect the committed changes.