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