]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix up non-directory creation in SGID directories
authorChristoph Hellwig <hch@lst.de>
Wed, 12 Apr 2023 04:26:18 +0000 (09:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:07:37 +0000 (12:07 +0200)
commitce133bd97de3bb78668820e4c4292cf4cfc50d4f
treefab978195fcc1432ce52f4055996ccb0c5fd3ccd
parentdb1d143066c8df70bb52e9da99d7d82e0718c61e
xfs: fix up non-directory creation in SGID directories

commit dd9241e55aaeab7fe40a1dd1f386b9c03ff521fe upstream.

XFS 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, see commit b7c7b802a3ed
("Fix up non-directory creation in SGID directories") for details.

Switch XFS to use the generic helper for the normal path to fix this,
just keeping the simple field inheritance open coded for the case of the
non-sgid case with the bsdgrpid mount option.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_inode.c