Re: [patch] EXT2 inode.i_generation patch

Jeremy Fitzhardinge (jeremy@goop.org)
Tue, 16 Mar 1999 10:15:03 -0800 (PST)


On 16-Mar-99 Chris Wedgwood wrote:
> Also, this is for each file open is it not? Doesn't that drastically
> increase the probability of getting collisions? (I don't really
> understand the intricacies involves here, so I'm not clear on whether
> or not this is more or less linear or otherwise).

Not really. In NFS, if you know the file handle you can access the file. At
the moment the file handle is made up of <dentry, ino, dirino, dev>. The
problem with this is that the handle won't change if the inode is reused.
Adding a generation number would make that <dentry, ino, dirino, dev, gen>.
Generation number collision only matters so long as the other 4 are the same,
so in effect you're only concerned about one single inode being assigned the
same generation number twice in succession.

NFS isn't very secure, and filehandle guessing attacks are often quite
successful with more simplisitic generation number generators. I think this
approach is about as good as you need to get - after all, it only takes a
packet sniffer to get any in-use filehandle you want.

The really obvious solution to reuse is to make a new generation number, and if
it matches the previous one, try again...

J

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