kernel_optimize_test/fs/ceph
Christian Brauner 6697f29bf5 ceph: fix up non-directory creation in SGID directories
commit fd84bfdddd169c219c3a637889a8b87f70a072c2 upstream.

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 0fa3ecd878 ("Fix up non-directory creation in SGID directories")
[2]: commit 01ea173e103e ("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: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-29 12:26:05 +01:00
..
acl.c
addr.c
cache.c
cache.h
caps.c ceph: fix duplicate increment of opened_inodes metric 2021-12-22 09:30:52 +01:00
ceph_frag.c
debugfs.c
dir.c ceph: allow ceph_put_mds_session to take NULL or ERR_PTR 2021-09-26 14:08:58 +02:00
export.c
file.c ceph: fix up non-directory creation in SGID directories 2021-12-29 12:26:05 +01:00
inode.c ceph: fix handling of "meta" errors 2021-10-27 09:56:51 +02:00
io.c
io.h
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c ceph: initialize pathlen variable in reconnect_caps_cb 2021-12-22 09:30:52 +01:00
mds_client.h
mdsmap.c ceph: fix possible null-pointer dereference in ceph_mdsmap_decode() 2021-09-08 08:49:01 +02:00
metric.c ceph: cancel delayed work instead of flushing on mdsc teardown 2021-09-26 14:08:58 +02:00
metric.h
quota.c
snap.c ceph: correctly handle releasing an embedded cap flush 2021-09-03 10:09:22 +02:00
strings.c
super.c ceph: properly handle statfs on multifs setups 2021-12-01 09:19:08 +01:00
super.h ceph: fix handling of "meta" errors 2021-10-27 09:56:51 +02:00
util.c
xattr.c