Skip to content

Drop CAP_FSETID if client needs to kill setuid/setgid bits

Vivek Goyal virtio-fs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4virtiofsd: Fix number of padding bits in fuse_file_infocontrib/virtiofsd/fuse_common.h+1 -12 replies
2/4virtiofsd: Use macros for write_flag parsingcontrib/virtiofsd/fuse_lowlevel.c+2 -21 reply
3/4virtiofsd: Parse flag FUSE_WRITE_KILL_PRIVcontrib/virtiofsd/fuse_common.h contrib/virtiofsd/fuse_kernel.h contrib/virtiofsd/fuse_lowlevel.c+7 -11 reply
4/4virtiofsd: Drop CAP_FSETID if client asked for itcontrib/virtiofsd/Makefile.objs contrib/virtiofsd/passthrough_ll.c contrib/virtiofsd/seccomp.c+131 -03 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchDr. David Alan Gilbert
1/4R-b
2/4R-b
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Virtio-fs] [PATCH 0/4] Drop CAP_FSETID if client needs to kill setuid/setgid bits

If a file has setuid/setuid bit set and a writer writes to file without having CAP_FSETID capability, kernel clears setuid/setgid bit on file.

pjdfstest test chmod/12.t tests for this. With moving to 5.3 kernel and cache=none this test fails.

Now Miklos has introducd a commit where if client thinks that setuid/setgid bit should be cleared, it sets FUSE_KILL_PRIV flag in fuse_write_in->write_flags. This is an indication to daemon to clear setuid/setgid bit atomically.

So drop CAP_FSETID capability and then proceed with write and that should automatically clear setuid bit.

Vivek Goyal (4):
virtiofsd: Fix number of padding bits in fuse_file_info
virtiofsd: Use macros for write_flag parsing
virtiofsd: Parse flag FUSE_WRITE_KILL_PRIV
virtiofsd: Drop CAP_FSETID if client asked for it

 contrib/virtiofsd/Makefile.objs    |   2 +
 contrib/virtiofsd/fuse_common.h    |   5 +-
 contrib/virtiofsd/fuse_kernel.h    |   1 +
 contrib/virtiofsd/fuse_lowlevel.c  |   6 +-
 contrib/virtiofsd/passthrough_ll.c | 127 +++++++++++++++++++++++++++++
 contrib/virtiofsd/seccomp.c        |   2 +
 6 files changed, 140 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.2