Re: [PATCH] dcache: trivial comment fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: J. Bruce Fields
Date: Tuesday, September 11, 2007 - 11:00 am

On Tue, Sep 11, 2007 at 07:33:43PM +0200, Neil Brown wrote:

The effect of it is that the name reported in /proc/<pid>/fd/<fd> is
random garbage if you're holding the target file open.  In quick tests,
I found that

	touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
	tail -f abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
	touch foo
	mv foo abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
	readlink /proc/<pid>/fd/<fd>

prints the initial portion of some other random name (often, not always,
"foo").

In theory I think that could disclose a little uninitialized kernel
memory, couldn't it?  I don't know if there's any practical way that
could be exploited.


Right.  But it looks like the contents of the buffer target->d_iname
also need to be initialized in this case--I suppose somebody just didn't
want to perform a memcpy they thought was pointless--so the name
reported in /proc is undefined.

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

Messages in current thread:
Re: [PATCH] dcache: trivial comment fix, Neil Brown, (Tue Sep 11, 10:33 am)
Re: [PATCH] dcache: trivial comment fix, J. Bruce Fields, (Tue Sep 11, 11:00 am)