fuse: Send FUSE_WRITE_KILL_SUIDGID for killpriv v1
Subsystems (2)
PATCH 1/1 fuse: Send FUSE_WRITE_KILL_SUIDGID for killpriv v1
FUSE doesn't seem to be adding the FUSE_WRITE_KILL_SUIDGID flag on write requests for FUSE connections that support FUSE_HANDLE_KILLPRIV but not FUSE_HANDLE_KILLPRIV_V2.
However, the FUSE userspace header states:
FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on write/chown/trunc ^^^^^
To improve backwards compatibility with file servers that don't support FUSE_HANDLE_KILLPRIV_V2, add the FUSE_WRITE_KILL_SUIDGID flag to write requests if FUSE_HANDLE_KILLPRIV has been negotiated -OR- if the conditions for FUSE_HANDLE_KILLPRIV_V2 support are met.
--- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/file.c +1 -1
@@ -1106,7 +1106,7 @@ static ssize_t fuse_send_write_pages(struct fuse_io_args *ia,fuse_write_args_fill (ia, ff, pos, count); ia->write.in.flags =fuse_write_flags (iocb); -if (fm->fc->handle_killpriv_v2 && !capable (CAP_FSETID )) +if (fm->fc->handle_killpriv || (fm->fc->handle_killpriv_v2 && !capable (CAP_FSETID ))) ia->write.in.write_flags |=FUSE_WRITE_KILL_SUIDGID ; err =fuse_simple_request (fm, &ap->args);
Signature · 1 line
2.30.2
Miklos Szeredi
maintainerQuoted 7 lines · Connor Kuehl
FUSE doesn't seem to be adding the
FUSE_WRITE_KILL_SUIDGIDflag on write requests for FUSE connections that supportFUSE_HANDLE_KILLPRIVbut notFUSE_HANDLE_KILLPRIV_V2.However, the FUSE userspace header states:
Quoted 8 lines
FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on write/chown/trunc
^^^^^To improve backwards compatibility with file servers that don't support
FUSE_HANDLE_KILLPRIV_V2, add theFUSE_WRITE_KILL_SUIDGIDflag to write requests ifFUSE_HANDLE_KILLPRIVhas been negotiated -OR- if the conditions forFUSE_HANDLE_KILLPRIV_V2support are met.
If server does not support FUSE_HANDLE_KILLPRIV_V2, then it does not support FUSE_WRITE_KILL_SUIDGID either. The two were introduced together and the latter is only meaningful if the FUSE_HANDLE_KILLPRIV_V2 feature was negotiated.
What am I missing?
Thanks,
Miklos
Quoted 18 lines · Miklos Szeredi
Quoted 7 lines · Connor Kuehl
FUSE doesn't seem to be adding the
FUSE_WRITE_KILL_SUIDGIDflag on write requests for FUSE connections that supportFUSE_HANDLE_KILLPRIVbut notFUSE_HANDLE_KILLPRIV_V2.However, the FUSE userspace header states:
Quoted 8 lines
FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on write/chown/trunc
^^^^^To improve backwards compatibility with file servers that don't support
FUSE_HANDLE_KILLPRIV_V2, add theFUSE_WRITE_KILL_SUIDGIDflag to write requests ifFUSE_HANDLE_KILLPRIVhas been negotiated -OR- if the conditions forFUSE_HANDLE_KILLPRIV_V2support are met.
Quoted 6 lines
If server does not support
FUSE_HANDLE_KILLPRIV_V2, then it does not supportFUSE_WRITE_KILL_SUIDGIDeither. The two were introduced together and the latter is only meaningful if theFUSE_HANDLE_KILLPRIV_V2feature was negotiated.What am I missing?
You're not missing anything, this patch is wrong. Let's nack this.
Thanks!
Connor