android_kernel_motorola_sm6375/fs/kernfs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Max Kellermann 133bf750d7 fs/kernfs/dir: obey S_ISGID
[ Upstream commit 5133bee62f0ea5d4c316d503cc0040cac5637601 ]

Handling of S_ISGID is usually done by inode_init_owner() in all other
filesystems, but kernfs doesn't use that function.  In kernfs, struct
kernfs_node is the primary data structure, and struct inode is only
created from it on demand.  Therefore, inode_init_owner() can't be
used and we need to imitate its behavior.

S_ISGID support is useful for the cgroup filesystem; it allows
subtrees managed by an unprivileged process to retain a certain owner
gid, which then enables sharing access to the subtree with another
unprivileged process.

--
v1 -> v2: minor coding style fix (comment)

Signed-off-by: Max Kellermann <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2024-02-23 08:25:03 +01:00
..
dir.c fs/kernfs/dir: obey S_ISGID 2024-02-23 08:25:03 +01:00
file.c
inode.c
Kconfig
kernfs-internal.h
Makefile
mount.c new helper: lookup_positive_unlocked() 2023-09-23 10:59:40 +02:00
symlink.c