mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [GIT PULL] fuse fix for 2.6.39
Date: Thu, 12 May 2011 12:28:52 -0400	[thread overview]
Message-ID: <1305217732.15566.31.camel@lade.trondhjem.org> (raw)
In-Reply-To: <BANLkTi=4rdtB5dQH=tycT1sybe7iJmTVcA@mail.gmail.com>

On Thu, 2011-05-12 at 08:19 -0700, Linus Torvalds wrote:
> Ooh.
> 
> It's "lookup_one_len()", isn't it?
> 
> So any filesystem that uses that helper will need to be protected from
> a NULL 'nd'.
> 
> And then you have nfsd, ecryptfs and cachefiles that will do it on
> _other_ filesystems.
>
> Gaah. Ugly. So either we really should fix the filesystems that don't
> have protection from a NULL nd, or we should fix lookup_one_len() (are
> there perhaps other cases I missed?)

As long as we have filesystems that need to rely on intents and that
have the ability to generate automount points, we should deprecate the
use of lookup_one_len() and add something else to help ecryptfs and co
to do safe component-wise lookups, opens and creates.

The point is that filesystems such as Fuse and NFSv4 rely on intents for
opens and file creation; even NFSv3 relies on it for doing safe O_EXCL
creates. For NFSv4, the struct nameidata carries not only the path
information, but also returns the fully initialised 'struct file'. Al
has plans to clean up that interface, but lookup_one_len() will still be
insufficient as a replacement.

NFS also requires look up using the full 'struct path' if/when we happen
upon an automount point (i.e. if we cross into a submounted filesystem
on the server or if we encounter an NFSv4 referral). Again, this is
something that lookup_one_len() can't do.

Trond

> Al? Christoph? Comments?
> 
>                             Linus
> 
> On Thu, May 12, 2011 at 8:12 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> > Hmm.
> >
> > Do we really ever have a NULL 'nd' these days? Can you send me the
> > backtrace for whatever oops that was reported?
> >
> > The reason I ask is because at least NFS also does just
> >
> >        if (nd->flags & LOOKUP_RCU)
> >                return -ECHILD;
> >
> > in its nfs_lookup/open_revalidate() functions. As does cifs, ncpfs, p9
> > and coda from a quick grep.
> >
> >                        Linus
> >
> > On Thu, May 12, 2011 at 8:04 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> >>
> >> Please pull from
> >>
> >>  git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-linus
> >>
> >> Miklos Szeredi (1):
> >>      fuse: fix oops in revalidate when called with NULL nameidata
> >>
> >> ---
> >>  fs/fuse/dir.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


  reply	other threads:[~2011-05-12 16:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 15:04 Miklos Szeredi
2011-05-12 15:12 ` Linus Torvalds
2011-05-12 15:19   ` Linus Torvalds
2011-05-12 16:28     ` Trond Myklebust [this message]
2011-05-12 17:21       ` Linus Torvalds
2011-05-12 17:40         ` Al Viro
2011-05-12 18:52           ` Trond Myklebust
2011-05-12 17:46         ` Trond Myklebust
2011-05-12 18:01           ` Linus Torvalds

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=1305217732.15566.31.camel@lade.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®