summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorYang Xu <xuyang2018.jy@fujitsu.com>2022-07-14 14:11:25 +0800
committerChristian Brauner (Microsoft) <brauner@kernel.org>2022-07-19 15:13:02 +0200
commit2b3416ceff5e6bd4922f6d1c61fb68113dd82302 (patch)
tree864514aa9a715b130d2162333656679cec33b23d /fs/namei.c
parentff6992735ade75aae3e35d16b17da1008d753d28 (diff)
downloadlinux-2b3416ceff5e6bd4922f6d1c61fb68113dd82302.tar.bz2
fs: add mode_strip_sgid() helper
Add a dedicated helper to handle the setgid bit when creating a new file in a setgid directory. This is a preparatory patch for moving setgid stripping into the vfs. The patch contains no functional changes. Currently the setgid stripping logic is open-coded directly in inode_init_owner() and the individual filesystems are responsible for handling setgid inheritance. Since this has proven to be brittle as evidenced by old issues we uncovered over the last months (see [1] to [3] below) we will try to move this logic into the vfs. Link: e014f37db1a2 ("xfs: use setattr_copy to set vfs inode attributes") [1] Link: 01ea173e103e ("xfs: fix up non-directory creation in SGID directories") [2] Link: fd84bfdddd16 ("ceph: fix up non-directory creation in SGID directories") [3] Link: https://lore.kernel.org/r/1657779088-2242-1-git-send-email-xuyang2018.jy@fujitsu.com Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Reviewed-and-Tested-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'fs/namei.c')
0 files changed, 0 insertions, 0 deletions