android_kernel_oneplus_msm8998/fs/ceph
Yan, Zheng 04f522476a ceph: fix recursion between ceph_set_acl() and __ceph_setattr()
commit 8179a101eb5f4ef0ac9a915fcea9a9d3109efa90 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.

Cc: stable@vger.kernel.org # needs backporting for < 4.9
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>
[luis: introduce __ceph_setattr() and make ceph_set_acl() call it, as
 suggested by Yan.]
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: “Yan, Zheng” <zyan@redhat.com>
2017-05-25 14:30:13 +02:00
..
acl.c ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-25 14:30:13 +02:00
addr.c mm, fs: introduce mapping_gfp_constraint() 2015-11-06 17:50:42 -08:00
cache.c ceph: fix a comment typo 2015-11-02 23:36:47 +01:00
cache.h ceph: fscache: add an interface to synchronize object store limit 2014-04-03 10:33:53 +08:00
caps.c ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
dir.c ceph: rework dcache readdir 2015-06-25 11:49:32 +03:00
export.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
file.c ceph: fix error handling in ceph_read_iter 2016-10-28 03:01:35 -04:00
inode.c ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-25 14:30:13 +02:00
ioctl.c ceph: fix divide-by-zero in __validate_layout() 2014-10-14 12:57:05 -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 Move locks API users to locks_lock_inode_wait() 2015-10-22 14:57:36 -04:00
Makefile ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
mds_client.c ceph: remove req from unsafe list when unregistering it 2017-03-15 09:57:13 +08:00
mds_client.h ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
mdsmap.c fs/ceph: replace pr_warning by pr_warn 2014-06-06 16:08:06 -07:00
snap.c ceph: fix queuing inode to mdsdir's snaprealm 2015-09-08 23:14:29 +03:00
strings.c ceph: rename snapshot support 2015-04-22 18:33:41 +03:00
super.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2015-09-11 12:33:03 -07:00
super.h ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-25 14:30:13 +02:00
xattr.c ceph: fix memory leak in __ceph_setxattr() 2017-05-20 14:27:01 +02:00