Re: Adding a field to ext2_dir_entry_2
From: Andreas Dilger
Date: Mon Apr 04 2005 - 20:14:15 EST
On Apr 04, 2005 20:08 -0400, Vineet Joglekar wrote:
> I have created another file system - copied everything from ext2,
> renaming it as some different file system and doing some experiments on that.
>
> Let me be more clear about what I am trying to do. In my masters
> project, I am encrypting inodes along with the data part of the file. Keys
> of different users are different. In the same directory, if there are
> 2 files stored by different users, their inodes will be encrypted with
> different keys. If user1 is doing "ls" on that directory, the inode
> of the other file - which is encrypted by user2, will be decrypted by
> using user1's key, resulting into garbage. To avoid this, I am trying
> to store the uid in the directry entry, so that I can match it with
> current->fsuid and skip decrypting the inode if the file doesn't belong
> to the current user. (assuming user1 doesnt want to share that file and
> different users can store different files under same directory.)
This is broken by design. What happens if you chown a file? The UID will
change in the inode, but nothing will be updated in the directory. This
key must be stored in the inode along with the ownership info (it can be
an EA, and possibly a fast EA or fixed inode field in a large inode).
Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.
Attachment:
pgp00000.pgp
Description: PGP signature