Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pavel Emelyanov <xemul@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, Rafael J. Wysocki <rjw@...>, Pavel Machek <pavel@...>, kernel list <linux-kernel@...>, netdev <netdev@...>
Date: Tuesday, November 27, 2007 - 8:36 am

Pavel Emelyanov <xemul@openvz.org> writes:


The cause is totally different this time, and is not limited
to /proc/net.  But this is the only side effect of the changes now.

I used the one line version of your test program to confirm this:

 $ cd /proc/driver/

 $ ls -l /proc/self/fd/100 100< .

 lr-x------ 1 eric eric 64 Nov 27 05:06 /proc/self/fd/100 -> /proc/driver/

 $  ls -l /proc/self/fd/100 100< .

 lr-x------ 1 eric eric 64 Nov 27 05:07 /proc/self/fd/100 -> /proc/driver (deleted)

What is happening is that the aggressive non-caching logic is dropping
the dentries and thus they show up as deleted.  I.e. When something
triggers another lookup of that dentry revalidate drops the old
dentry.

This actually fixes a race in /proc today where if you open a file,
remove the module for it, reload the module for that file, and then
attempt to access it, lookup will return the old dentry with the
old fops (even if there is not a current version of that file).
kill_proc_inodes current keeps us from using the old version of
the file_operations for directories (because it removes them) but
it does not prevent this DOS attack where keeping a proc file open
always ensures everyone will see the old version.

Given that the behavior seems more correct then what we have currently
I can live with files showing up as deleted from time to time.

Ultimately the fix is to correct the caching logic in
fs/proc/generic.c to only drop dentries when necessary and then
the deleted markers will only show up when the file or directory
really goes away.

I don't expect user space will care about the semi-legitimate
(deleted) marks.  So I don't think this one down side will be a big
deal for 2.6.24.

Eric




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.24-rc3: find complains about /proc/net, Pavel Machek, (Mon Nov 19, 3:10 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Rafael J. Wysocki, (Mon Nov 19, 6:04 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Pavel Emelyanov, (Tue Nov 20, 11:51 am)
[PATCH 2.6.24-rc3] Fix /proc/net breakage, Eric W. Biederman, (Mon Nov 26, 6:17 pm)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, David Woodhouse, (Fri Dec 7, 12:51 am)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Andrew Morton, (Fri Dec 7, 6:23 am)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Andreas Mohr, (Thu Dec 27, 1:40 pm)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Alexey Dobriyan, (Thu Dec 27, 2:41 pm)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Andreas Mohr, (Thu Dec 27, 6:17 pm)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Alexey Dobriyan, (Fri Dec 28, 2:22 am)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Andreas Mohr, (Fri Dec 28, 3:21 am)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Denis V. Lunev, (Fri Dec 7, 7:11 am)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Pavel Emelyanov, (Tue Nov 27, 7:20 am)
Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage, Eric W. Biederman, (Tue Nov 27, 8:36 am)
[CFT][PATCH] proc_net: Remove userspace visible changes., Eric W. Biederman, (Sat Nov 24, 7:34 pm)
Re: [CFT][PATCH] proc_net: Remove userspace visible changes., Eric W. Biederman, (Mon Nov 26, 4:43 am)
Re: 2.6.24-rc3: find complains about /proc/net, Eric W. Biederman, (Wed Nov 21, 2:36 am)
Re: 2.6.24-rc3: find complains about /proc/net, Pavel Emelyanov, (Wed Nov 21, 5:36 am)
Re: 2.6.24-rc3: find complains about /proc/net, Eric W. Biederman, (Tue Nov 20, 9:19 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Eric W. Biederman, (Tue Nov 20, 5:52 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Ingo Molnar, (Tue Nov 20, 5:59 pm)
[PATCH] proc: Fix the threaded /proc/self., Eric W. Biederman, (Tue Nov 20, 6:41 pm)
Re: [PATCH] proc: Fix the threaded /proc/self., Ingo Molnar, (Tue Nov 20, 7:03 pm)
Re: [PATCH] proc: Fix the threaded /proc/self., Guillaume Chazarain, (Tue Nov 20, 6:58 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Eric W. Biederman, (Tue Nov 20, 6:17 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Ingo Molnar, (Tue Nov 20, 6:35 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Roland McGrath, (Tue Nov 20, 6:54 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Ingo Molnar, (Tue Nov 20, 7:01 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Guillaume Chazarain, (Tue Nov 20, 7:06 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Ingo Molnar, (Tue Nov 20, 7:43 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Roland McGrath, (Tue Nov 20, 7:26 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Ulrich Drepper, (Tue Nov 20, 7:32 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Eric W. Biederman, (Tue Nov 20, 8:41 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Ingo Molnar, (Tue Nov 20, 7:45 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Roland McGrath, (Tue Nov 20, 7:51 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Eric W. Biederman, (Tue Nov 20, 8:47 pm)
Re: 2.6.24-rc3: find complains about /proc/net, Rafael J. Wysocki, (Tue Nov 20, 9:01 pm)