diff options
author | Max Kellermann <max.kellermann@ionos.com> | 2023-12-08 10:33:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-15 17:22:40 +0100 |
commit | 5133bee62f0ea5d4c316d503cc0040cac5637601 (patch) | |
tree | 88f212335c31aafcb840ace7ff61f179e39f79ad /init/initramfs.c | |
parent | kernel/cgroup: use kernfs_create_dir_ns() (diff) | |
download | linux-5133bee62f0ea5d4c316d503cc0040cac5637601.tar.xz linux-5133bee62f0ea5d4c316d503cc0040cac5637601.zip |
fs/kernfs/dir: obey S_ISGID
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 <max.kellermann@ionos.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20231208093310.297233-2-max.kellermann@ionos.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'init/initramfs.c')
0 files changed, 0 insertions, 0 deletions