linux-mainline/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
addr.c ceph: allow queueing cap/snap handling after putting cap references 2021-02-16 12:09:51 +01:00
cache.c
cache.h
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
debugfs.c
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
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
io.h
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c
mds_client.h
mdsmap.c
metric.c
metric.h
quota.c
snap.c ceph: defer flushing the capsnap if the Fb is used 2021-02-16 12:09:52 +01:00
strings.c
super.c
super.h idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
util.c
xattr.c