Page MenuHomeFreeBSD

capsicum_helpers: split stream cap bits out of caph_limit_stream()
ClosedPublic

Authored by kevans on Jan 1 2020, 8:53 PM.
Tags
None
Referenced Files
F81588746: D22993.id66277.diff
Thu, Apr 18, 2:10 PM
F81572116: D22993.id.diff
Thu, Apr 18, 7:14 AM
Unknown Object (File)
Fri, Mar 22, 9:04 PM
Unknown Object (File)
Fri, Mar 22, 9:04 PM
Unknown Object (File)
Fri, Mar 22, 9:04 PM
Unknown Object (File)
Fri, Mar 22, 9:04 PM
Unknown Object (File)
Mar 8 2024, 7:37 AM
Unknown Object (File)
Mar 7 2024, 10:24 AM
Subscribers

Details

Summary

The goal here is to make it so applications can take the rights one would normally get by calling caph_limit_stream() on a descriptor and build on them as needed.

My current use-case is inetd, where the control socket's rights will be caph_stream_rights() + ACCEPT/BIND/LISTEN/SETSOCKOPT, and once a client connects we limit those sockets further to caph_stream_rights() + SETSOCKOPT. inetd must at least use a superset of caph_stream_rights in case invoked program leads to caph_limit_stdio(), which is quite common. I *think* this is a feasible approach, at least.

Diff Detail

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

Event Timeline

This seems ok to me. Shouldn't caph_stream_rights() be documented?

It might also be nice to have a caph_limit_stream_rights() or whatever which uses a caller-supplied rights set and limits ioctls like caph_limit_stream() does. I'm not sure if that's really useful though.

lib/libcapsicum/capsicum_helpers.h
51 ↗(On Diff #66218)

I think the backslash is not needed.

This revision is now accepted and ready to land.Jan 2 2020, 2:41 PM

LGTM.
Like @markj mentioned please add it to man page.

kevans marked an inline comment as done.

Amend capsicum_helpers(3) and remove useless escape.

This revision now requires review to proceed.Jan 2 2020, 9:30 PM
This revision is now accepted and ready to land.Jan 2 2020, 10:36 PM