linux/fs/ceph
Yan, Zheng 51bd778ac8 ceph: fix recursion between ceph_set_acl() and __ceph_setattr()
commit 8179a101eb upstream.

ceph_set_acl() calls __ceph_setattr() if the setacl operation needs
to modify inode's i_mode. __ceph_setattr() updates inode's i_mode,
then calls posix_acl_chmod().

The problem is that __ceph_setattr() calls posix_acl_chmod() before
sending the setattr request. The get_acl() call in posix_acl_chmod()
can trigger a getxattr request. The reply of the getxattr request
can restore inode's i_mode to its old value. The set_acl() call in
posix_acl_chmod() sees old value of inode's i_mode, so it calls
__ceph_setattr() again.

Link: http://tracker.ceph.com/issues/19688
Reported-by: Jerry Lee <leisurelysw24@gmail.com>
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Luis Henriques <lhenriques@suse.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
[bwh: Backported to 3.16: All the changes are made in ceph_setattr() as
 there is no __ceph_setattr() function.]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-07-18 18:40:39 +01:00
..
acl.c posix_acl: Clear SGID bit when setting file permissions 2016-11-20 01:17:38 +00:00
addr.c ceph: do_sync is never initialized 2015-01-15 10:44:10 +00:00
cache.c ceph: fscache: Wait for completion of object initialization 2014-04-03 10:33:53 +08:00
cache.h ceph: fscache: add an interface to synchronize object store limit 2014-04-03 10:33:53 +08:00
caps.c mds: check cap ID when handling cap export message 2014-06-06 09:29:55 +08:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c fs/ceph/debugfs.c: replace seq_printf by seq_puts 2014-06-06 16:08:06 -07:00
dir.c move d_rcu from overlapping d_child to overlapping d_alias 2015-01-15 10:44:58 +00:00
export.c ceph: ceph_get_parent() can be static 2014-06-06 09:29:50 +08:00
file.c ceph: Correctly return NXIO errors from ceph_llseek 2016-11-20 01:16:59 +00:00
inode.c ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-07-18 18:40:39 +01:00
ioctl.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2014-05-05 15:17:02 -07:00
ioctl.h ceph: fully initialize new layout 2012-05-16 14:28:27 -05:00
Kconfig ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
locks.c locks: ensure that fl_owner is always initialized properly in flock and lease codepaths 2014-06-02 08:09:29 -04:00
Makefile ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
mds_client.c ceph: fix bad endianness handling in parse_reply_info_extra 2017-03-16 02:27:01 +00:00
mds_client.h ceph: include time stamp in every MDS request 2014-06-06 09:30:00 +08:00
mdsmap.c fs/ceph: replace pr_warning by pr_warn 2014-06-06 16:08:06 -07:00
snap.c ceph: introduce global empty snap context 2015-02-17 15:12:01 +00:00
strings.c ceph: add get_name() NFS export callback 2014-04-03 10:33:53 +08:00
super.c fs: create and use seq_show_option for escaping 2015-09-29 16:44:47 +01:00
super.h ceph: introduce global empty snap context 2015-02-17 15:12:01 +00:00
xattr.c ceph: don't include ceph.{file,dir}.layout vxattr in listxattr() 2014-04-04 21:07:21 -07:00