[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzt1LN77WgFbdEak0f-JssQH64pSL=1zYAfB7=B8pxwvQ@mail.gmail.com>
Date: Fri, 4 Oct 2013 13:49:13 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: James Morris <jmorris@...ei.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
LSM List <linux-security-module@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: security: lockless stat() issues
On Fri, Oct 4, 2013 at 1:15 PM, Al Viro <viro@...iv.linux.org.uk> wrote:
>
> Just a couple of days ago you'd been complaining about filesystems exposure
> to rcuwalk details and now you propose to increase the contact surface
> by one more method? OK...\
.. anything for a really critical path.
> For one thing, that will definitely require lazy freeing of struct
> super_block itself. At the very least, you want ->i_sb->s_dev, even
> on default pathway. Another thing is that API is wrong for that
> kind of stuff - we pass vfsmount/dentry pair and we end up looking
> at the inode guts. Fine, but in RCU case you must cope with the
> possibility of dentry->d_inode going NULL under you. Which isn't
> all that terrible, but we need to slap ACCESS_ONCE() into each method
> instance (all 34 of them). IOW, it's worse than just "oh, we need to
> add a flag"; we'll need to pass the sodding inode separately, with
> dire warnings not to use dentry->d_inode.
That would get ugly.
However, I don't think we actually really need to do that. We had a
similar situation with d_revalidate() passing inode pointers etc
totally unnecessarily. Yes, the filesystem needs to use ACCESS_ONCE()
and care about NULL, but it doesn't need anything more than that. And
we really do have that already.
And we already have dentry->d_sb - which is supposed to be valid.
Again, we already use it under RCU for d_revalidate() and for name
hashing. So the super-block had better already be ok with RCU.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists