ceph: update the time stamps and try to drop the suid/sgid
authorXiubo Li <xiubli@redhat.com>
Mon, 13 Feb 2023 05:56:20 +0000 (13:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:40:08 +0000 (09:40 +0100)
commitefa228b2e6a45ce8410db02d9d82c61b4f294fde
treed92a6a01526da4525f62a2e9e40e8744be2df21f
parenta73783e4e0c4d1507794da211eeca75498544dff
ceph: update the time stamps and try to drop the suid/sgid

commit e027253c4b77d395798600a90b6a96fe4adf4d5e upstream.

The fallocate will try to clear the suid/sgid if a unprevileged user
changed the file.

There is no POSIX item requires that we should clear the suid/sgid
in fallocate code path but this is the default behaviour for most of
the filesystems and the VFS layer. And also the same for the write
code path, which have already support it.

And also we need to update the time stamps since the fallocate will
change the file contents.

Cc: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/58054
Signed-off-by: Xiubo Li <xiubli@redhat.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>
fs/ceph/file.c