kernfs: allow creating kernfs objects with arbitrary uid/gid
This change allows creating kernfs files and directories with arbitrary uid/gid instead of always using GLOBAL_ROOT_UID/GID by extending kernfs_create_dir_ns() and kernfs_create_file_ns() with uid/gid arguments. The "simple" kernfs_create_file() and kernfs_create_dir() are left alone and always create objects belonging to the global root. When creating symlinks ownership (uid/gid) is taken from the target kernfs object. Co-Developed-by:Tyler Hicks <tyhicks@canonical.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by:
Tyler Hicks <tyhicks@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c 3 additions, 1 deletionarch/x86/kernel/cpu/intel_rdt_rdtgroup.c
- fs/kernfs/dir.c 26 additions, 3 deletionsfs/kernfs/dir.c
- fs/kernfs/file.c 6 additions, 2 deletionsfs/kernfs/file.c
- fs/kernfs/inode.c 1 addition, 1 deletionfs/kernfs/inode.c
- fs/kernfs/kernfs-internal.h 2 additions, 0 deletionsfs/kernfs/kernfs-internal.h
- fs/kernfs/symlink.c 10 additions, 1 deletionfs/kernfs/symlink.c
- fs/sysfs/dir.c 3 additions, 1 deletionfs/sysfs/dir.c
- fs/sysfs/file.c 3 additions, 2 deletionsfs/sysfs/file.c
- include/linux/kernfs.h 19 additions, 9 deletionsinclude/linux/kernfs.h
- kernel/cgroup/cgroup.c 3 additions, 1 deletionkernel/cgroup/cgroup.c
Loading
Please register or sign in to comment