]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: use consistent setgid checks in is_sxid()
authorChristian Brauner <brauner@kernel.org>
Sat, 18 Mar 2023 10:15:28 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:30:08 +0000 (13:30 +0100)
commit183ca919544c898dfbb40f6b26d33bfe8765a986
tree464803be39c8d167205d7557fdb52f810890fd44
parent0e9dbde96cacd0e95e05e862b50f3079146917f2
fs: use consistent setgid checks in is_sxid()

commit 8d84e39d76bd83474b26cb44f4b338635676e7e8 upstream.

Now that we made the VFS setgid checking consistent an inode can't be
marked security irrelevant even if the setgid bit is still set. Make
this function consistent with all other helpers.

Note that enforcing consistent setgid stripping checks for file
modification and mode- and ownership changes will cause the setgid bit
to be lost in more cases than useed to be the case. If an unprivileged
user wrote to a non-executable setgid file that they don't have
privilege over the setgid bit will be dropped. This will lead to
temporary failures in some xfstests until they have been updated.

Reported-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/fs.h