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-next>] [day] [month] [year] [list]
Message-ID: <4ED6FA2C.7010005@oracle.com>
Date:	Wed, 30 Nov 2011 21:53:16 -0600
From:	Dave Kleikamp <dave.kleikamp@...cle.com>
To:	Chris Dunlop <chris@...he.net.au>
CC:	David Howells <dhowells@...hat.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	"Myklebust, Trond" <Trond.Myklebust@...app.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Eric Van Hensbergen <ericvh@...il.com>,
	Ron Minnich <rminnich@...dia.gov>,
	Latchesar Ionkov <lucho@...kov.net>,
	Jan Harkes <jaharkes@...cmu.edu>,
	"\"maintainer@...he.net.au\":CODA FILE SYSTEM" <coda@...cmu.edu>,
	Petr Vandrovec <petr@...drovec.name>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	v9fs-developer@...ts.sourceforge.net,
	linux-afs@...ts.infradead.org, codalist@...EMANN.coda.cs.cmu.edu,
	jfs-discussion@...ts.sourceforge.net, linux-nfs@...r.kernel.org
Subject: Re: [PATCH 1/1] fix d_revalidate oopsen on NFS exports



On 11/30/2011 09:33 PM, Chris Dunlop wrote:
> On Wed, Nov 30, 2011 at 08:22:39PM -0600, Dave Kleikamp wrote:
>> On 11/30/2011 06:47 PM, Chris Dunlop wrote:
>>>> It's also worth printing a message - this *is* a kernel bug of some description
>>>> if it happens.
>>>
>>> Like the below?  This covers the d_revalidate for 9p, afs, coda,
>>> hfs, ncpfs, proc, sysfs.
>>>
>>> Note:  jfs isn't susceptible to this problem, but the resolution
>>> doesn't look like the other file systems, and from the comment
>>> I'm not sure if the problem was really understood and if it's
>>> doing the right thing:
>>
>> This code, as well as the comments, were copied from vfat. It seems
>> reasonable for case-insensitive but case-preserving behavior (not jfs's
>> default). The safe thing is to drop the negative dentry if we don't know
>> the operation.
> 
> In that case, it looks like the thing to do might be to add the
> "protection" to the start of jfs_ci_revaliate(), per how the
> original has been changed in vfat:

The LOOKUP_RCU check had previously been there, but Al Viro removed it:

commit 5c0f360b083fb33d05d1bff4b138b82d715eb419
Author: Al Viro <viro@...iv.linux.org.uk>
Date:   Sat Jun 25 21:41:09 2011 -0400

    jfs_ci_revalidate() is safe from RCU mode

I'm not sure what it takes to be "safe", but this is a simple function
that doesn't block, take locks, or do much of anything. You shouldn't
need to do anything with jfs.

Shaggy

> 
> fs/fat/namei_vfat.c:
> static int vfat_revalidate_ci(struct dentry *dentry, struct nameidata *nd)
> {
>         if (nd && nd->flags & LOOKUP_RCU)
>                 return -ECHILD;
>         ...
> }
> 
> E.g.:
> 
> ----------------------------------------------------------------------
> Don't oops when abused by broken layered file systems
> 
> Signed-off-by: Chris Dunlop <chris@...he.net.au>
> ---
>  fs/jfs/namei.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
> index e17545e..5504f6e 100644
> --- a/fs/jfs/namei.c
> +++ b/fs/jfs/namei.c
> @@ -1585,6 +1585,9 @@ out:
>  
>  static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd)
>  {
> +	if (nd && nd->flags & LOOKUP_RCU)
> +		return -ECHILD;
> +
>  	/*
>  	 * This is not negative dentry. Always valid.
>  	 *
--
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