Skip to content

Fix handling of file capabilities. #11704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

Fix handling of file capabilities.

All the following changes are compatible with what Linux does.

  • Do not attempt to apply file capabilities when it is not present.
  • If the rootID specified in v3 file capability struct does not own the
    current userns, then file capabilities are not applied.
  • While applying file capabilities, EPERM is only returned if
    VFS_CAP_FLAGS_EFFECTIVE is set.
  • Re-raise capabilities of root user as per capabilities(7). Compare
    security/commoncap.c:handle_privileged_root().

All the following changes are compatible with what Linux does.
- Do not attempt to apply file capabilities when it is not present.
- If the rootID specified in v3 file capability struct does not own the
  current userns, then file capabilities are not applied.
- While applying file capabilities, EPERM is only returned if
  VFS_CAP_FLAGS_EFFECTIVE is set.
- Re-raise capabilities of root user as per capabilities(7). Compare
  security/commoncap.c:handle_privileged_root().

PiperOrigin-RevId: 756179837
@copybara-service copybara-service bot added the exported Issue was exported automatically label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant