[linux] 02/05: ceph: Propagate dentry down to inode_change_ok()
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Wed Nov 16 18:27:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
carnil pushed a commit to branch sid
in repository linux.
commit 055cd5a2d165d9eb5ae787cf5aaab6a0746e2090
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Sun Nov 13 11:34:07 2016 +0100
ceph: Propagate dentry down to inode_change_ok()
---
debian/changelog | 1 +
...-Propagate-dentry-down-to-inode_change_ok.patch | 77 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 79 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 5a7465c..8ed7565 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -44,6 +44,7 @@ linux (4.8.8-1) UNRELEASED; urgency=medium
[ Salvatore Bonaccorso ]
* Bump ABI to 2 and remove ABI reference for 4.8.0-1
* xfs: Propagate dentry down to inode_change_ok()
+ * ceph: Propagate dentry down to inode_change_ok()
-- Salvatore Bonaccorso <carnil at debian.org> Tue, 15 Nov 2016 22:01:08 +0100
diff --git a/debian/patches/bugfix/all/ceph-Propagate-dentry-down-to-inode_change_ok.patch b/debian/patches/bugfix/all/ceph-Propagate-dentry-down-to-inode_change_ok.patch
new file mode 100644
index 0000000..5d49506
--- /dev/null
+++ b/debian/patches/bugfix/all/ceph-Propagate-dentry-down-to-inode_change_ok.patch
@@ -0,0 +1,77 @@
+From: Jan Kara <jack at suse.cz>
+Date: Thu, 26 May 2016 16:10:38 +0200
+Subject: ceph: Propagate dentry down to inode_change_ok()
+Origin: https://git.kernel.org/linus/fd5472ed44683cf593322a2ef54b9a7675dc780a
+
+To avoid clearing of capabilities or security related extended
+attributes too early, inode_change_ok() will need to take dentry instead
+of inode. ceph_setattr() has the dentry easily available but
+__ceph_setattr() is also called from ceph_set_acl() where dentry is not
+easily available. Luckily that call path does not need inode_change_ok()
+to be called anyway. So reorganize functions a bit so that
+inode_change_ok() is called only from paths where dentry is available.
+
+Reviewed-by: Christoph Hellwig <hch at lst.de>
+Acked-by: Jeff Layton <jlayton at redhat.com>
+Signed-off-by: Jan Kara <jack at suse.cz>
+---
+ fs/ceph/acl.c | 5 +++++
+ fs/ceph/inode.c | 19 +++++++++++--------
+ 2 files changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c
+index d0b6b342..987044b 100644
+--- a/fs/ceph/acl.c
++++ b/fs/ceph/acl.c
+@@ -125,6 +125,11 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+ goto out_free;
+ }
+
++ if (ceph_snap(inode) != CEPH_NOSNAP) {
++ ret = -EROFS;
++ goto out_free;
++ }
++
+ if (new_mode != old_mode) {
+ newattrs.ia_mode = new_mode;
+ newattrs.ia_valid = ATTR_MODE;
+diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
+index dd3a6db..2aa3c0bc 100644
+--- a/fs/ceph/inode.c
++++ b/fs/ceph/inode.c
+@@ -1905,13 +1905,6 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
+ int inode_dirty_flags = 0;
+ bool lock_snap_rwsem = false;
+
+- if (ceph_snap(inode) != CEPH_NOSNAP)
+- return -EROFS;
+-
+- err = inode_change_ok(inode, attr);
+- if (err != 0)
+- return err;
+-
+ prealloc_cf = ceph_alloc_cap_flush();
+ if (!prealloc_cf)
+ return -ENOMEM;
+@@ -2124,7 +2117,17 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
+ */
+ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
+ {
+- return __ceph_setattr(d_inode(dentry), attr);
++ struct inode *inode = d_inode(dentry);
++ int err;
++
++ if (ceph_snap(inode) != CEPH_NOSNAP)
++ return -EROFS;
++
++ err = inode_change_ok(inode, attr);
++ if (err != 0)
++ return err;
++
++ return __ceph_setattr(inode, attr);
+ }
+
+ /*
+--
+2.10.2
+
diff --git a/debian/patches/series b/debian/patches/series
index 6599818..407b349 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -94,6 +94,7 @@ features/all/securelevel/arm64-add-kernel-config-option-to-set-securelevel-wh.pa
bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
bugfix/all/xfs-Propagate-dentry-down-to-inode_change_ok.patch
+bugfix/all/ceph-Propagate-dentry-down-to-inode_change_ok.patch
# ABI maintenance
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list