Page MenuHomeFreeBSD

unix: Preserve FD_RESOLVE_BENEATH when passing an fd
Needs ReviewPublic

Authored by markj on Fri, May 22, 10:12 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The FD_RESOLVE_BENEATH flag is supposed to be sticky. It's set when you
receive an fd from a different jail and preserved by openat(<dfd>) etc..
However, if you send the fd to yourself, the flag is stripped since
SCM_RIGHTS message don't preserve file descriptor flags.

Fix this by preserving those flags and checking for UF_RESOLVE_BENEATH
in restrict_rights().

Diff Detail

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