aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-04-27 14:38:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-04-27 14:38:05 -0400
commit19ac4474203863a8141663d73d5976fe25464bfd (patch)
tree2a2435b52c0dab6a36f77d293d01498b03f25be3
parentf56fc7bdaa22e7b2fac18de430db8195d2dfd7bd (diff)
parent8179a101eb5f4ef0ac9a915fcea9a9d3109efa90 (diff)
Merge tag 'ceph-for-4.11-rc9' of git://github.com/ceph/ceph-client
Pull ceph fix from Ilya Dryomov: "A fix for a kernel stack overflow bug in ceph setattr code, marked for stable" * tag 'ceph-for-4.11-rc9' of git://github.com/ceph/ceph-client: ceph: fix recursion between ceph_set_acl() and __ceph_setattr()
-rw-r--r--fs/ceph/inode.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index d449e1c03cbd..d3119fe3ab45 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2071,11 +2071,6 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
2071 if (inode_dirty_flags) 2071 if (inode_dirty_flags)
2072 __mark_inode_dirty(inode, inode_dirty_flags); 2072 __mark_inode_dirty(inode, inode_dirty_flags);
2073 2073
2074 if (ia_valid & ATTR_MODE) {
2075 err = posix_acl_chmod(inode, attr->ia_mode);
2076 if (err)
2077 goto out_put;
2078 }
2079 2074
2080 if (mask) { 2075 if (mask) {
2081 req->r_inode = inode; 2076 req->r_inode = inode;
@@ -2089,13 +2084,11 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
2089 ceph_cap_string(dirtied), mask); 2084 ceph_cap_string(dirtied), mask);
2090 2085
2091 ceph_mdsc_put_request(req); 2086 ceph_mdsc_put_request(req);
2092 if (mask & CEPH_SETATTR_SIZE)
2093 __ceph_do_pending_vmtruncate(inode);
2094 ceph_free_cap_flush(prealloc_cf);
2095 return err;
2096out_put:
2097 ceph_mdsc_put_request(req);
2098 ceph_free_cap_flush(prealloc_cf); 2087 ceph_free_cap_flush(prealloc_cf);
2088
2089 if (err >= 0 && (mask & CEPH_SETATTR_SIZE))
2090 __ceph_do_pending_vmtruncate(inode);
2091
2099 return err; 2092 return err;
2100} 2093}
2101 2094
@@ -2114,7 +2107,12 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
2114 if (err != 0) 2107 if (err != 0)
2115 return err; 2108 return err;
2116 2109
2117 return __ceph_setattr(inode, attr); 2110 err = __ceph_setattr(inode, attr);
2111
2112 if (err >= 0 && (attr->ia_valid & ATTR_MODE))
2113 err = posix_acl_chmod(inode, attr->ia_mode);
2114
2115 return err;
2118} 2116}
2119 2117
2120/* 2118/*