Linux NFS development
 help / color / mirror / Atom feed
From: Ming Zhang <blackmagic02881@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: nfs@lists.sourceforge.net
Subject: Re: question about fh_copy
Date: Sun, 28 Jan 2007 19:36:39 -0500	[thread overview]
Message-ID: <1170030999.9144.8.camel@localhost.localdomain> (raw)
In-Reply-To: <20070128230148.GB12125@fieldses.org>

On Sun, 2007-01-28 at 18:01 -0500, J. Bruce Fields wrote:
> On Sat, Jan 27, 2007 at 10:20:08AM -0500, Ming Zhang wrote:
> > A question about fh_copy(). This function is called many times on
> > argument passed directly from nfs clients. If a malicious nfs client
> > forge a fh, then fh_copy can invoke oops quite easily.
> 
> I don't see how; can you explain?

svc_process at http://lxr.linux.no/source/net/sunrpc/svc.c?v=2.6.18#L386
invoke a rpc processing function, for example, nfsd3_proc_getattr
then at http://lxr.linux.no/source/fs/nfsd/nfs3proc.c?v=2.6.18#L64
invoke fh_copy before fh_verify. since src coming from client, client
can forge a fh to let code
http://lxr.linux.no/source/include/linux/nfsd/nfsfh.h?v=2.6.18#L222 get
executed. if fh_dentry is a invalid pointer, it can get oops.

or think in another way, if the fh will always be valid with all
contents, then what is the point to call fh_verify to do "sanity checks
on the dentry in a client file handle", quoted from fh_verify comment at
http://lxr.linux.no/source/fs/nfsd/nfsfh.c?v=2.6.18#L105?

Ming

> 
> --b.
-- 
http://blackmagic02881.wordpress.com/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-01-29  0:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-27 15:20 question about fh_copy Ming Zhang
2007-01-28 23:01 ` J. Bruce Fields
2007-01-29  0:36   ` Ming Zhang [this message]
2007-01-29  1:04     ` J. Bruce Fields
2007-01-29 14:10       ` Ming Zhang
2007-01-29 20:35         ` rpc.gssd segfault on FC5 client Jim Davis
2007-01-29 22:02           ` Kevin Coffman
2007-01-29 22:06             ` Jim Davis
2007-01-29 22:44               ` Kevin Coffman
2007-01-29 22:49                 ` Jim Davis
2007-01-29 23:18                   ` Kevin Coffman
2007-01-29 23:34                     ` Jim Davis
2007-01-30  0:02                       ` Kevin Coffman

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=1170030999.9144.8.camel@localhost.localdomain \
    --to=blackmagic02881@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=nfs@lists.sourceforge.net \
    /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