lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 20 Oct 2007 15:04:39 -0400
From:	Erez Zadok <ezk@...sunysb.edu>
To:	Trond Myklebust <trond.myklebust@....uio.no>
Cc:	Erez Zadok <ezk@...sunysb.edu>, bfields@...ldses.org,
	nfs@...ts.sourceforge.net, neilb@...e.de,
	linux-kernel@...r.kernel.org
Subject: Re: nfsv2 ref leak in 2.6.24? 

In message <1192900351.7440.6.camel@...mdal.trondhjem.org>, Trond Myklebust writes:
> 
> On Fri, 2007-10-19 at 22:33 -0400, Erez Zadok wrote:
> > Trond, good news.  I was able to narrow down the problem to purely the
> > client-side, probably dcache/readdir related, and I have a shell script that
> > deterministically triggers the problem each time for me (this is a FC6 image
> > under Vmware 6.0.1).  Here's a short shell script which reliably triggers
> > the "lost files" problem -- I create a file via nfs2 on the client side, and
> > sometimes it doesn't show up in readdir, but it is there if you stat it
> > directly.
> 
> Ah... I got confused as to what you were measuring and where.

Yeah, I wasn't sure myself until I narrowed it down to a small test case.

> Looking at
> nfs_proc_create(), there is indeed a missing call to
> nfs_mark_for_revalidate(). The reason why you need such a call being the
> usual one: NFSv2 doesn't provide post-op attributes for the directory.
> 
> The patch below ought to fix the problem.

It fixes some, but breaks others.  The test script I sent yesterday indeed
passes.  And more of my unionfs-on-nfs2 tests pass, but not all.  Three of
my unionfs tests (create w/ copyup, unlink open files, and unlink with a
whiteout) fail b/c they detect leftover silly-renamed files.  Worse, now the
same three tests also fail when I use unionfs on top of nfs3/nfs4: before
the one line fix below, unionfs-on-nfsv3/4 worked fine.

Was there any significant semantic change in the behaviour of silly-renamed
files in nfs in 2.6.24?  If so, then I may have to change how unionfs
handles refcounts and such.

I'll try to dig deeper and see if I can come up with a small test case that
doesn't involve unionfs.

Thanks,
Erez.

> Cheers
>   Trond
> ---------------------- CUT HERE -----------------------
> From: Trond Myklebust <Trond.Myklebust@...app.com>
> Date: Sat, 20 Oct 2007 13:07:21 -0400
> NFSv2: Ensure that the directory metadata gets revalidated on file create
> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@...app.com>
> ---
> 
>  fs/nfs/proc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
> index 97669ed..4f80d88 100644
> --- a/fs/nfs/proc.c
> +++ b/fs/nfs/proc.c
> @@ -211,6 +211,7 @@ nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
>  	nfs_fattr_init(&fattr);
>  	dprintk("NFS call  create %s\n", dentry->d_name.name);
>  	status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
> +	nfs_mark_for_revalidate(dir);
>  	if (status == 0)
>  		status = nfs_instantiate(dentry, &fhandle, &fattr);
>  	dprintk("NFS reply create: %d\n", status);

Erez.
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ