Re: silent semantic changes with reiser4

From: Rik van Riel
Date: Thu Aug 26 2004 - 14:19:07 EST


On Thu, 26 Aug 2004, Linus Torvalds wrote:
> On Thu, 26 Aug 2004, Rik van Riel wrote:
> >
> > So you'd have both a file and a directory that just happen
> > to have the same name ? How would this work in the dcache?
>
> There would be only one entry in the dcache. The lookup will select
> whether it opens the file or the directory based on O_DIRECTORY (and
> usage, of course - if it's in the middle of a path, it obviously needs to
> be opened as a directory regardless).

Hmmm, I just straced "cp /bin/bash /tmp".
One line stood out as a potential problem:

open("/tmp/bash", O_WRONLY|O_CREAT|O_LARGEFILE, 0100755) = 4

What do we do with O_CREAT ?

Do we always allow both a directory and a file to be created with
the same name ?

Does this create a new class of "symlink attack" style security
holes ?


--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/