Skip to content

Conversation

@slp
Copy link
Collaborator

@slp slp commented Feb 6, 2026

While we were announcing it, we never really supported KILLPRIV, so this was breaking some fs tests. This PR stops announcing KILLPRIV support, and implements support for KILLPRIV_V2.

slp added 6 commits February 6, 2026 15:49
We never really supported HANDLE_KILLPRIV, so let's be honest about it
and stop announcing it.

Signed-off-by: Sergio Lopez <[email protected]>
We're going to need this library in the next commit libcap-ng-dev.

Signed-off-by: Sergio Lopez <[email protected]>
KILLPRIV_V2 is a FUSE flag that indicates that the filesystem is
responsible for clearing security.capability xattr and clearing setuid
and setgid bits, following these rules:

- clear "security.capability" on write, truncate and chown unconditionally
- clear suid/sgid if following is true. Note, sgid is cleared only if
  group executable bit is set.
    o setattr has FATTR_SIZE and FATTR_KILL_SUIDGID set.
    o setattr has FATTR_UID or FATTR_GID
    o open has O_TRUNC and FUSE_OPEN_KILL_SUIDGID
    o create has O_TRUNC and FUSE_OPEN_KILL_SUIDGID flag set.

Signed-off-by: Sergio Lopez <[email protected]>
Those structs were mostly redundant, converge on InodeHandle. This also
allows us to simplify and unify many code paths.

Signed-off-by: Sergio Lopez <[email protected]>
Reuse the previously obtained libc::stat with get_xattr_* to avoid an
additional stat syscall.

Signed-off-by: Sergio Lopez <[email protected]>
Enable set_xattr_stat to receive a bindings::stat struct so we it can
be provided in the cases where we've already obtained it, saving an
additional stat syscall.

Signed-off-by: Sergio Lopez <[email protected]>
@slp slp force-pushed the virtiofs-killpriv-v2 branch from 33af184 to 1c23c77 Compare February 6, 2026 14:54
@slp
Copy link
Collaborator Author

slp commented Feb 6, 2026

Tested with pjdfstest on both Linux and macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant