linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jeff Layton <jlayton@redhat.com>
Cc: Jan Kara <jack@suse.cz>, Al Viro <viro@ZenIV.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, xfs@oss.sgi.org,
	Dave Chinner <david@fromorbit.com>,
	Ilya Dryomov <idryomov@gmail.com>, Sage Weil <sage@redhat.com>,
	"Yan, Zheng" <zyan@redhat.com>,
	ceph-devel@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [PATCH 2/5] ceph: Propagate dentry down to inode_change_ok()
Date: Thu, 22 Sep 2016 10:50:01 +0200	[thread overview]
Message-ID: <20160922085001.GG2834@quack2.suse.cz> (raw)
In-Reply-To: <1474311422.5754.39.camel@redhat.com>

On Mon 19-09-16 14:57:02, Jeff Layton wrote:
> On Mon, 2016-09-19 at 17:30 +0200, Jan Kara wrote:
> > 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.
> > 
> > > Signed-off-by: Jan Kara <jack@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 013151d50069..a2cedfde75eb 100644
> > --- a/fs/ceph/acl.c
> > +++ b/fs/ceph/acl.c
> > @@ -127,6 +127,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;
> > > +	}
> > +
> 
> So to make sure I understand: What's the expected behavior when someone
> changes the ACL in such a way that the mode gets changed? Should
> security_inode_killpriv be getting called in that case? If so, where
> does that happen, as I don't see notify_change being called in this
> codepath?

No. security_inode_killpriv() is supposed to be called when either contents
of the file changes (truncate, write) or when owner of the file changes. It
is not called for permission changes.

...
> Looks reasonable though:
> 
> Acked-by: Jeff Layton <jlayton@redhat.com>

Thanks for review!

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2016-09-22  8:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 15:30 [PATCH 0/5 v2 RESEND] fs: Avoid premature clearing of file capabilities Jan Kara
2016-09-19 15:30 ` [PATCH 1/5] xfs: Propagate dentry down to inode_change_ok() Jan Kara
2016-09-19 15:30 ` [PATCH 2/5] ceph: " Jan Kara
2016-09-19 18:57   ` Jeff Layton
2016-09-22  8:50     ` Jan Kara [this message]
2016-09-22 17:20       ` Jeff Layton
2016-09-26 10:25         ` Jan Kara
2016-09-23  7:45   ` Yan, Zheng
2016-09-19 15:30 ` [PATCH 3/5] fuse: " Jan Kara
2016-09-19 15:30 ` [PATCH 4/5] fs: Give dentry to inode_change_ok() instead of inode Jan Kara
2016-09-19 15:30 ` [PATCH 5/5] fs: Avoid premature clearing of capabilities Jan Kara
2016-09-19 15:38 ` [PATCH 0/5 v2 RESEND] fs: Avoid premature clearing of file capabilities Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2016-08-03 11:28 [PATCH 0/5 v2] " Jan Kara
2016-08-03 11:28 ` [PATCH 2/5] ceph: Propagate dentry down to inode_change_ok() Jan Kara
2016-05-26 16:19 [PATCH 0/5] fs: Avoid premature clearing of file capabilities Jan Kara
2016-05-26 16:19 ` [PATCH 2/5] ceph: Propagate dentry down to inode_change_ok() Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922085001.GG2834@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=david@fromorbit.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=sage@redhat.com \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=xfs@oss.sgi.org \
    --cc=zyan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).