Page MenuHomeFreeBSD

socket: Pass capsicum rights down to socket option handlers
AcceptedPublic

Authored by markj on Fri, Jun 21, 4:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 2:26 PM
Unknown Object (File)
Sun, Jun 23, 5:24 PM
Subscribers

Details

Reviewers
glebius
gallatin
Summary

One needs the CAP_GETSOCKOPT and CAP_SETSOCKOPT rights to call
getsockopt(2) and setsockopt(2) on a socket descriptor, respectively.
The syscall layer checks this, but individual socket option handlers
have no access to the file descriptor and so can't check for additional
rights, should the want to do so. In particular, a forthcoming
implementation of SO_SPLICE logically requires at least the CAP_RECV
right.

Modify the syscall layer to look up Capsicum rights on the descriptor
and pass that along to socket option handlers; this way, the handlers
can check for additional rights if they need to.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58282
Build 55170: arc lint + arc unit