2006-03-03 16:13:15

by Steven Timm

[permalink] [raw]
Subject: NFS possible race condition, nfs_unlink vs. d_lookup


I found the description of an old patch against what
was then the 2.5.72 kernel.

http://kernel.tuke.sk/pub/linux/kernel/people/akpm/patches/2.5/2.5.72/2.5.72-mm3/broken-out/nfs_unlink-d_count-fix.patch

The description was the following, on that web site.

- nfs_unlink() can race with lockless d_lookup() as d_lookup() can
successfully lookup a dentry for which nfs_unlink() can assume that no
one
else is using and can go ahead and do nfs_safe_remove() on it. By using
per dentry lock, it is solved as we d_lookup() will fail the lookup for
unhashed dentries.


My question.. is the 2.4.21-37 kernel as distributed by Red Hat also
vulnerable to this race condition? If so, is there any
patch that is available? The code in dir.c in the 2.4 series
kernel is different enough such that this patch won't apply to it.

Thanks

Steve Timm







--
------------------------------------------------------------------
Steven C. Timm, Ph.D (630) 840-8525 [email protected] http://home.fnal.gov/~timm/
Fermilab Computing Div/Core Support Services Dept./Scientific Computing Section
Assistant Group Leader, Farms and Clustered Systems Group
Lead of Computing Farms Team


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2006-03-03 20:48:04

by Trond Myklebust

[permalink] [raw]
Subject: Re: NFS possible race condition, nfs_unlink vs. d_lookup

On Fri, 2006-03-03 at 09:57 -0600, Steven Timm wrote:

> My question.. is the 2.4.21-37 kernel as distributed by Red Hat also
> vulnerable to this race condition? If so, is there any
> patch that is available? The code in dir.c in the 2.4 series
> kernel is different enough such that this patch won't apply to it.

No idea. Are you saying that RedHat shipped a 2.4.x kernel with RCU
patches to the vfs before they had been tested in the 2.6.x kernel?

Cheers,
Trond



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-03-03 21:22:27

by Trond Myklebust

[permalink] [raw]
Subject: Re: NFS possible race condition, nfs_unlink vs. d_lookup

On Fri, 2006-03-03 at 15:15 -0600, Steven Timm wrote:

> I don't have enough expertise to tell what they have done. I
> can attach the dir.c in question if someone is able to look.
> All I know is that we are seeing a similar condition, namely
> nfs_safe_remove errors happening on our client, for what
> this patch was supposed to fix in the 2.5/2.6 series kernels.
> Any help would be appreciated.

Have you checked if the same problem exists on a more recent 2.4.x
kernel (say 2.4.28)? If not, then there may be a patch floating around
in the patch graveyard on

http://client.linux-nfs.org/Linux-2.4.x/

Cheers,
Trond



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-03-03 21:29:33

by Steven Timm

[permalink] [raw]
Subject: Re: NFS possible race condition, nfs_unlink vs. d_lookup

On Fri, 3 Mar 2006, Trond Myklebust wrote:

> On Fri, 2006-03-03 at 09:57 -0600, Steven Timm wrote:
>
>> My question.. is the 2.4.21-37 kernel as distributed by Red Hat also
>> vulnerable to this race condition? If so, is there any
>> patch that is available? The code in dir.c in the 2.4 series
>> kernel is different enough such that this patch won't apply to it.
>
> No idea. Are you saying that RedHat shipped a 2.4.x kernel with RCU
> patches to the vfs before they had been tested in the 2.6.x kernel?

I don't have enough expertise to tell what they have done. I
can attach the dir.c in question if someone is able to look.
All I know is that we are seeing a similar condition, namely
nfs_safe_remove errors happening on our client, for what
this patch was supposed to fix in the 2.5/2.6 series kernels.
Any help would be appreciated.


Steve Timm


>
> Cheers,
> Trond
>
>

--
------------------------------------------------------------------
Steven C. Timm, Ph.D (630) 840-8525 [email protected] http://home.fnal.gov/~timm/
Fermilab Computing Div/Core Support Services Dept./Scientific Computing Section
Assistant Group Leader, Farms and Clustered Systems Group
Lead of Computing Farms Team


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-03-07 12:36:25

by Steve Dickson

[permalink] [raw]
Subject: Re: NFS possible race condition, nfs_unlink vs. d_lookup

Sorry for the delayed response...

Steven Timm wrote:
> My question.. is the 2.4.21-37 kernel as distributed by Red Hat also
> vulnerable to this race condition?
Not that I'm aware of...

steved.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs