LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-23-2011, 11:35 AM   #1
paragamritkar
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Rep: Reputation: Disabled
Use specific field in inode to store information?


Can we use any specific field in inode (VFS inode cache) of a file to store some information such as storing key of encryption for that file?
If possible then how?
 
Old 09-24-2011, 05:47 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Welcome to LQ Security.

In Linux, inodes are a data structure that is used to hold information regarding the file (e.g. location, permissions, access times, etc). As far as I know the structure is semi-fixed. The inode cache is an array of copies of the inodes where the inodes are indexed by a hashing function. By its nature the table would be rather volatile with data being read and written to the it continuously. In essence, it doesn't sound like a good place to store information, even if there were extra padded, or blank fields in the inode structure to store information. You would then have the complications of getting information into and out of the structure and this would need to be built into the kernel itself.

All told, it doesn't sounds like a very safe or efficient practice to me. Perhaps you could expand upon your theory?
 
1 members found this post helpful.
Old 09-24-2011, 04:27 PM   #3
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
If you need to store non-sensitive per-file information, consider xattrs.

Storing the key used to encrypt a file anywhere on the disk as-is is insecure.
You could store the public part of a public-private key pair into an xattr, however.

In userspace, you could write wrappers around the file I/O syscalls, to check for the encryption xattr, and if encrypted, ask a keyring manager for the corresponding key; if successful, your library would decrypt the file transparently. Encryption is of course possible too, but specifying which key to use is a bit of a problem unless the user only uses one key for encryption at a time. Without the library, and/or the key, programs can only access the encrypted contents. (Many tools will drop the xattr, though, so you do need to check that backups et cetera retain the public key in the xattr. Otherwise you cannot decrypt the file transparently, and even by hand is tedious since you need to try each of the keys you have to find the one that works.)

You can of course replace the library later on with a kernel module, which overrides the read and write vfs ops, if the file is/should be encrypted at open time, and then underlying fs supports xattrs.

Hope this helps.
 
1 members found this post helpful.
Old 09-28-2011, 10:38 PM   #4
paragamritkar
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
We can use xattr but it is quite transparent and there are many tools that can give you contents of those attributes.
We will be doing this as a inherent functionality to frequent context switch problem of user space utilities.
Our idea is basically:

The proposed Secure File System (SecFS), we will be providing file data security using cryptographic techniques in a transparent and convenient way. The proposed SecFS pushes encryption services into the Linux kernel space, mounting it between the virtual file system layer and underlying file system. After SecFS is integrated with the Linux operating system (OS), it enables OS to provide file data security as its inherent functionality. SecFS requires that the user creates a directory and name it with the prefix 'ecrypt' to store the encrypted file data, such as ecryptdir. Any directory on the system with the prefix 'ecrypt' will basically tells the system that the newly created directory will contain encrypted data. All files destined to be saved on this directory will be transparently encrypted on the fly without any user intervention. SecFS will be fully compatible with all underlying storage file systems.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
information of in-core inode Pratik dhamdhere Linux - General 1 11-21-2010 09:24 AM
Information store: What software could I use to store and access various info merixon Linux - Software 2 12-17-2008 11:51 AM
Cant store ip address to bash field Mangled Programming 10 10-10-2007 01:32 PM
Getting INode information Morpheus Linux - General 1 04-27-2007 06:38 AM
Information needed about the use of the reserved field in the inode structure calsoft_pg Linux - Software 1 12-23-2005 10:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration