fuse: add a flag FUSE_OPEN_KILL_SUIDGID for open() request
authorVivek Goyal <vgoyal@redhat.com>
Fri, 9 Oct 2020 18:15:11 +0000 (14:15 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 11 Nov 2020 16:22:33 +0000 (17:22 +0100)
commit643a666a89c358ef588d2b3ef9f2dc1efc421e61
tree6e9065257d8d01110e3aa26e8cfc5a87295b32dd
parent8981bdfda7445af5d5a8c277c923bf91873a0c98
fuse: add a flag FUSE_OPEN_KILL_SUIDGID for open() request

With FUSE_HANDLE_KILLPRIV_V2 support, server will need to kill suid/sgid/
security.capability on open(O_TRUNC), if server supports
FUSE_ATOMIC_O_TRUNC.

But server needs to kill suid/sgid only if caller does not have CAP_FSETID.
Given server does not have this information, client needs to send this info
to server.

So add a flag FUSE_OPEN_KILL_SUIDGID to fuse_open_in request which tells
server to kill suid/sgid (only if group execute is set).

This flag is added to the FUSE_OPEN request, as well as the FUSE_CREATE
request if the create was non-exclusive, since that might result in an
existing file being opened/truncated.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dir.c
fs/fuse/file.c
include/uapi/linux/fuse.h