• Christian Brauner's avatar
    ceph: fix up non-directory creation in SGID directories · fd84bfdd
    Christian Brauner authored
    Ceph always inherits the SGID bit if it is set on the parent inode,
    while the generic inode_init_owner does not do this in a few cases where
    it can create a possible security problem (cf. [1]).
    
    Update ceph to strip the SGID bit just as inode_init_owner would.
    
    This bug was detected by the mapped mount testsuite in [3]. The
    testsuite tests all core VFS functionality and semantics with and
    without mapped mounts. That is to say it functions as a generic VFS
    testsuite in addition to a mapped mount testsuite. While working on
    mapped mount support for ceph, SIGD inheritance was the only failing
    test for ceph after the port.
    
    The same bug was detected by the mapped mount testsuite in XFS in
    January 2021 (cf. [2]).
    
    [1]: commit 0fa3ecd8 ("Fix up non-directory creation in SGID directories")
    [2]: commit 01ea173e ("xfs: fix up non-directory creation in SGID directories")
    [3]: https://git.kernel.org/fs/xfs/xfstests-dev.git
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    fd84bfdd
file.c 66.7 KB