fuse: add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID
authorVivek Goyal <vgoyal@redhat.com>
Thu, 25 Mar 2021 15:18:23 +0000 (11:18 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 14 Apr 2021 08:40:57 +0000 (10:40 +0200)
commit550a7d3bc0c4049ef8d36ff4d9ed7082ee8cb5ec
tree7d2266a677214950a303ae1eb69803a0faeff9c4
parent52a4c95f4d24b8bcb50745732f7b9f8513c49c5f
fuse: add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID

When posix access ACL is set, it can have an effect on file mode and it can
also need to clear SGID if.

- None of caller's group/supplementary groups match file owner group.
AND
- Caller is not priviliged (No CAP_FSETID).

As of now fuser server is responsible for changing the file mode as
well. But it does not know whether to clear SGID or not.

So add a flag FUSE_SETXATTR_ACL_KILL_SGID and send this info with SETXATTR
to let file server know that sgid needs to be cleared as well.

Reported-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/acl.c
include/uapi/linux/fuse.h