From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Dave Jones <davej@redhat.com>,
xfs@oss.sgi.com, Linux Kernel <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: fs/attr.c:notify_change locking warning.
Date: Wed, 16 Oct 2013 21:26:51 +1100 [thread overview]
Message-ID: <20131016102651.GF4446@dastard> (raw)
In-Reply-To: <20131016070528.GB18721@infradead.org>
On Wed, Oct 16, 2013 at 12:05:28AM -0700, Christoph Hellwig wrote:
> On Wed, Oct 16, 2013 at 08:36:18AM +1100, Dave Chinner wrote:
> > Sure, but file_remove_suid() doesn't actually modify any VFS inode
> > structures until we process the flags and the modifications within
> > ->setattr, which in XFS are all done under the XFS_ILOCK_EXCL via
> > xfs_setattr_mode(). i.e. both the VFS and XFS inodes S*ID bits are
> > removed only under XFS_ILOCK_EXCL....
>
> It can set S_NOSEC after calling into ->setattr at least.
>
> > Hence I see no point in adding extra serialisation via the i_mutex
> > to this path when we can just do something like:
> >
> > killsuid = should_remove_suid(file->f_path.dentry);
> > if (killsuid) {
> > struct iattr newattr;
> >
> > newattr.ia_valid = ATTR_FORCE | killsuid;
> > error = xfs_setattr_nonsize(ip, &newattr, 0);
> > if (error)
> > return error;
> > }
>
> We'd still need all the other magic in file_remove_suid, which I don't
> actually quite undersdtand fully yet.
The killpriv calls? I couldn't find anything that implemented those
security hooks nor any documentation about it, so I'm pretty much
clueless about it. FWIW, ocfs2 doesn't implement them, either....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2013-10-16 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-05 0:52 fs/attr.c:notify_change locking warning Dave Jones
2013-10-05 3:19 ` Dave Chinner
2013-10-15 20:19 ` Christoph Hellwig
2013-10-15 21:36 ` Dave Chinner
2013-10-16 7:05 ` Christoph Hellwig
2013-10-16 10:26 ` Dave Chinner [this message]
2013-10-16 18:12 ` Christoph Hellwig
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=20131016102651.GF4446@dastard \
--to=david@fromorbit.com \
--cc=davej@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=xfs@oss.sgi.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