linux-stable/fs/ceph
Jeff Layton ed94f87c2b ceph: don't allow type or device number to change on non-I_NEW inodes
Al pointed out that a malicious or broken MDS could change the type or
device number of a given inode number. It may also be possible for the
MDS to reuse an old inode number.

Ensure that we never allow fill_inode to change the type part of the
i_mode or the i_rdev unless I_NEW is set. Throw warnings if the MDS ever
changes these on us mid-stream, and return an error.

Don't set i_rdev directly, and rely on init_special_inode to do it.
Also, fix up error handling in the callers of ceph_get_inode.

In handle_cap_grant, check for and warn if the inode type changes, and
only overwrite the mode if it didn't.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2021-03-08 10:19:37 -05:00
..
acl.c fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
addr.c ceph: allow queueing cap/snap handling after putting cap references 2021-02-16 12:09:51 +01:00
cache.c ceph: replace zero-length array with flexible-array member 2020-03-30 12:42:40 +02:00
cache.h libceph, rbd, ceph: convert to use the new mount API 2019-11-27 22:28:37 +01:00
caps.c ceph: don't allow type or device number to change on non-I_NEW inodes 2021-03-08 10:19:37 -05:00
ceph_frag.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
debugfs.c ceph: add status debugfs file 2020-12-14 23:21:47 +01:00
dir.c ceph: fix up error handling with snapdirs 2021-03-08 10:19:36 -05:00
export.c ceph: fix up error handling with snapdirs 2021-03-08 10:19:36 -05:00
file.c libceph, rbd, ceph: "blacklist" -> "blocklist" 2020-10-12 15:29:26 +02:00
inode.c ceph: don't allow type or device number to change on non-I_NEW inodes 2021-03-08 10:19:37 -05:00
io.c ceph: add buffered/direct exclusionary locking for reads and writes 2019-09-16 12:06:25 +02:00
io.h ceph: add buffered/direct exclusionary locking for reads and writes 2019-09-16 12:06:25 +02:00
ioctl.c ceph: consider inode's last read/write when calculating wanted caps 2020-03-30 12:42:42 +02:00
ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig libceph: replace HTTP links with HTTPS ones 2020-08-03 11:05:26 +02:00
locks.c ceph: fix up some warnings on W=1 builds 2020-12-14 23:21:47 +01:00
Makefile ceph: add dentry lease metric support 2020-06-01 13:22:51 +02:00
mds_client.c libceph, ceph: disambiguate ceph_connection_operations handlers 2021-01-04 17:31:32 +01:00
mds_client.h ceph: take a cred reference instead of tracking individual uid/gid 2020-12-14 23:21:48 +01:00
mdsmap.c libceph, ceph: get and handle cluster maps with addrvecs 2020-12-14 23:21:50 +01:00
metric.c ceph: send dentry lease metrics to MDS daemon 2020-12-14 23:21:47 +01:00
metric.h ceph: send dentry lease metrics to MDS daemon 2020-12-14 23:21:47 +01:00
quota.c Revert "ceph: allow rename operation under different quota realms" 2020-12-14 23:21:47 +01:00
snap.c ceph: defer flushing the capsnap if the Fb is used 2021-02-16 12:09:52 +01:00
strings.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
super.c ceph: add new RECOVER mount_state when recovering session 2020-12-14 23:21:46 +01:00
super.h idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
util.c ceph: move net/ceph/ceph_fs.c to fs/ceph/util.c 2020-01-27 16:53:40 +01:00
xattr.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00