[7196] in bugtraq
Re: Linux kernel filesystem oddities
daemon@ATHENA.MIT.EDU (Pavel Kankovsky)
Thu Jul 9 16:01:08 1998
Date: Wed, 8 Jul 1998 22:42:21 +0200
Reply-To: peak@kerberos.troja.mff.cuni.cz
From: Pavel Kankovsky <peak@KERBEROS.TROJA.MFF.CUNI.CZ>
To: BUGTRAQ@NETSPACE.ORG
In-Reply-To: <Pine.LNX.3.96.980706144956.252A-100000@lcamtuf>
On Mon, 6 Jul 1998, Michal Zalewski wrote:
> > FIFO itself occupies a single inode, no block, therefore charging inode
> > quota but not block quota is correct.
>
> It's not charged at all. Set inode quota to something reasonable, then
> create any amount FIFOs in /tmp.
Argh. You're right. There is this STUPID statement at the beginning of
dquot_initialize() (fs/dquot.c):
if (S_ISREG(inode->i_mode) ||
S_ISDIR(inode->i_mode) ||
S_ISLNK(inode->i_mode))
This is a bug!
> >> But there will be problem with hard-links - creator of this object is...
> > Hardlink is not a fs object, it is a directory entry.
>
> Yep. I mean, we need more information about these entries - who really
> CREATED entry... But it's a major change in filesystem architecture and I
> don't think it's possible...
It would be rather confusing if directory entries themselves had their own
attributes.
> > The world writable directory is a real problem. It is similar to world
> > writable files: anyone can use them to store data on its owner.
>
> They are not similar, because directory stores data about owner of entries
> in it. Kernel provides mechanism to limit it, but unfortunately, this
> mechanism is waek.
Owners are stored in i-nodes. Directory entries are nothing but
(filename, i-node number) pairs.
link("publicly-visible-file", "world-writable-directory/blah")
is as anonymous as
write(open("/world-writable-file", O_WRONLY), "blah", 4)
--Pavel Kankovsky aka Peak [ Boycott Microsoft--http://www.vcnet.com/bms ]
"You can't be truly paranoid unless you're sure they have already got you."