ceph: don't allow access to MDS-private inodes
authorJeff Layton <jlayton@kernel.org>
Thu, 1 Apr 2021 17:55:11 +0000 (13:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 09:40:54 +0000 (11:40 +0200)
commit3611ce2f23a4be659eae66da2ee7acafd6e5b267
treef7e41a7869e76030fb0324e26aa8bd25bb8933a2
parentdb275714dd506db541f4a17f1549a2ec7f8d3ef6
ceph: don't allow access to MDS-private inodes

[ Upstream commit d4f6b31d721779d91b5e2f8072478af73b196c34 ]

The MDS reserves a set of inodes for its own usage, and these should
never be accessible to clients. Add a new helper to vet a proposed
inode number against that range, and complain loudly and refuse to
create or look it up if it's in it.

Also, ensure that the MDS doesn't try to delegate inodes that are in
that range or lower. Print a warning if it does, and don't save the
range in the xarray.

URL: https://tracker.ceph.com/issues/49922
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/export.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/super.h