Skip to contentSkip to conversation

Hi

DISCUSSION Rajaram Suresh Gaunker 6 participants 13 messages Feb 18, 2003 – Feb 19, 2003 VFS

lore
Share & tools
lore
#0 lore raw

Hi

I want to make a copy of ext2 file system to exist with a different name of my choice.

Actually i want to convert ext2 to into a encryped file system. for this purpose i want to do that,

i've copied the ext2 file system code, and changed its name in init function but when i try to mount some fs with the new name it is saying that it is not supporting,

wher is the VFS file system code exist.

bye
Rajaram

R@j@r@m

#1 lore raw
Quoted 5 lines · Rajaram Suresh Gaunker

I want to make a copy of ext2 file system to exist with a different name of my choice.

Actually i want to convert ext2 to into a encryped file system. for this purpose i want to do that,

I already explained you that for security reasons this functionality should be in the block layer, not in the filesystem layer.

Quoted 5 lines

i've copied the ext2 file system code, and changed its name in init function but when i try to mount some fs with the new name it is saying that it is not supporting,

wher is the VFS file system code exist.

Seth Arnold already told you to look in fs/* .

Why don't you actually do something with the replies people already gave you? You just annoy people when you ask the same question over and over again.

Erik

Signature · 2 lines
J.A.K. (Erik) Mouw
Email: [email protected]  [email protected]
#2 lore raw
Quoted 5 lines · Erik Mouw
Quoted 2 lines

Actually i want to convert ext2 to into a encryped file system. for this purpose i want to do that,

I already explained you that for security reasons this functionality should be in the block layer, not in the filesystem layer.

Why?

Signature · 1 line
dwmw2
#3 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"david" == David Woodhouse <[email protected]> writes:

Quoted 5 lines · Erik Mouw
Quoted 5 lines
Quoted 2 lines

Actually i want to convert ext2 to into a encryped file system. for this purpose i want to do that,

I already explained you that for security reasons this functionality should be in the block layer, not in the filesystem layer.

david> Why?

If you do it at the filesystem layer you:
a- leave the filesystem structure (i.e. names) unencrypted b- you just don't care if you are not able to recover things at fsck
time :(
c- you are really clever and finds a way to encrypt all the filesystem
and recovering from a crash

Apart from that, doing it at the block layer should be much, much easier :)

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#4 lore raw

On Wed, 2003-02-19 at 14:54, Juan Quintela wrote (re encryption):

Quoted 2 lines

If you do it at the filesystem layer you:
a- leave the filesystem structure (i.e. names) unencrypted

Why would you want to do that? It's not really an invariant property of encryption-capable file systems, surely? You can crypt the names if you want to.

Quoted 2 lines

b- you just don't care if you are not able to recover things at fsck
time :(

Likewise. It might be decreed that file sizes and directory tree structure are an acceptable leak of information and hence you can have a fsck which just doesn't grok either filenames, permissions or data -- or you might decide that's not an acceptable leak, and require the key in order to fsck it. You need the key in order to fsck a file system on an encrypted block device _anyway_, right?

Quoted 2 lines

c- you are really clever and finds a way to encrypt all the filesystem
and recovering from a crash

Parse error.

Quoted 2 lines

Apart from that, doing it at the block layer should be much, much easier :)

Filesystems are hard. Let's go shopping :)

Doing redundancy at the block layer is much much easier too. That doesn't necessarily make it not suck when a raid rebuild is pointlessly copying blocks which aren't actually _referenced_ by the file system, because it doesn't have the knowledge about the layout that the file system does.

Signature · 1 line
dwmw2
#5 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"david" == David Woodhouse <[email protected]> writes:

david> On Wed, 2003-02-19 at 14:54, Juan Quintela wrote (re encryption):

Quoted 2 lines
Quoted 2 lines

If you do it at the filesystem layer you:
a- leave the filesystem structure (i.e. names) unencrypted

david> Why would you want to do that? It's not really an invariant property of david> encryption-capable file systems, surely? You can crypt the names if you david> want to.

Some paranoid security person, don't want an attacker to know what file to atack :p

I.e. that the attacker is able to read a name like:

here_is_where_we_store_security_passworkds.txt

And they have the same problem for only giving them the filesystem structure :(

Quoted 2 lines
Quoted 2 lines

b- you just don't care if you are not able to recover things at fsck time :(

david> Likewise. It might be decreed that file sizes and directory tree david> structure are an acceptable leak of information and hence you can have a david> fsck which just doesn't grok either filenames, permissions or data -- or david> you might decide that's not an acceptable leak, and require the key in david> order to fsck it. You need the key in order to fsck a file system on an david> encrypted block device _anyway_, right?

Yep, problem is that you have a corrupted filesystem, you know the key, but you don't know what kind of information has this block. If the block is encrypted, bets are basically off :( you can't apply easily heuristics :( Was that blocked ever used, and then its value is encrypted/have nothing interesting?

Quoted 2 lines
Quoted 2 lines

c- you are really clever and finds a way to encrypt all the filesystem and recovering from a crash

david> Parse error.

Quoted 2 lines
Quoted 2 lines

Apart from that, doing it at the block layer should be much, much easier :)

david> Filesystems are hard. Let's go shopping :)

david> Doing redundancy at the block layer is much much easier too. That david> doesn't necessarily make it not suck when a raid rebuild is pointlessly david> copying blocks which aren't actually _referenced_ by the file system, david> because it doesn't have the knowledge about the layout that the file david> system does.

I think that the only reason why encryption at the filesystem level makes sense is when you want to only encrypt _some_ files, but at that point, you can also encrypt by hand them with some script/similar :(

About that things are easier at the filesystem level than at the block device, yes, they exist, another example is snapshots. Snapshots at the block level are easy to do, they just use a lot of disk space. At the filesystem level, they are more eficient (duplicated info is minimal), but you need to be very, very careful to implement them at the filesystem level. At the block level it is _almost_ trivial (at least when you compare it with an implementation at the filesystem level).

It just happens that from my point of view, encryption is a lot easier and more secure done at the Block layer level.

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#6 lore raw
Quoted 3 lines · Juan Quintela

I think that the only reason why encryption at the filesystem level makes sense is when you want to only encrypt _some_ files, but at that point, you can also encrypt by hand them with some script/similar :(

Or do something like libz: on the fly or even transparent encryption/decryption of files.

Erik

Signature · 2 lines
J.A.K. (Erik) Mouw
Email: [email protected]  [email protected]
#7 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"erik" == Erik Mouw <[email protected]> writes:

Quoted 3 lines · Juan Quintela
Quoted 3 lines

I think that the only reason why encryption at the filesystem level makes sense is when you want to only encrypt _some_ files, but at that point, you can also encrypt by hand them with some script/similar :(

erik> Or do something like libz: on the fly or even transparent erik> encryption/decryption of files.

I meaned basically to do it out of kernel land, that solution also works for me :)

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#8 lore raw
In reply to David Woodhouse
Quoted 8 lines · David Woodhouse
Quoted 5 lines · Erik Mouw
Quoted 2 lines

Actually i want to convert ext2 to into a encryped file system. for this purpose i want to do that,

I already explained you that for security reasons this functionality should be in the block layer, not in the filesystem layer.

Why?

File level encryption gives an attacker information about the files on your system.

Suppose I can get hold of your disk and I want to know if you are subscribed to linux-kernel. I just mount the disk, and if I find a file called "dwmw2/Mail/linux-kernel", it gives me a large hint you are indeed subscribed. No, I can't decrypt the file, but that wasn't my purpose. I do however know the file metadata, like the filename, the owner, modification time, length, etc.

So I know you are subscribed to linux-kernel. I can't read the file, but that's not necessary because I can also get the plain text of the linux-kernel mailing list, which is enough to do a known plaintext attack on your cipher. How hard that is depends of course on the cipher and your key, but given enough computerpower it is possible to crack your key.

The way to solve this is to encrypt at the block level. In that way I can't even mount the filesystem when I don't have the correct key, so I can't get to the file metadata. Sure, I could guess you're using ext3, but that still leaves too many uncertainties (like directory layout and filesystem usage) for an attacker to be able to crack your key. A brute force attack will succeed (maybe not in the estimated lifetime of the universe), but it's a lot harder than a brute force known plain text attack.

Interesting to note is that NTFS supports file level encyption, but nobody actually uses it. People who need encrypted files usually buy a third party product that encrypts at the block level.

Erik

Signature · 2 lines
J.A.K. (Erik) Mouw
Email: [email protected]  [email protected]
#9 lore raw
Quoted 9 lines · Erik Mouw

File level encryption gives an attacker information about the files on your system.

Suppose I can get hold of your disk and I want to know if you are subscribed to linux-kernel. I just mount the disk, and if I find a file called "dwmw2/Mail/linux-kernel", it gives me a large hint you are indeed subscribed. No, I can't decrypt the file, but that wasn't my purpose. I do however know the file metadata, like the filename, the owner, modification time, length, etc.

Not if the metadata were encrypted too.

You speak only of block-level encryption and of file-level (i.e. application-based) encryption. But don't forget that there's a layer _between_ the applications and the block device. :)

My question was what's wrong with doing encryption in the file system?

Signature · 1 line
dwmw2
#10 lore raw
Quoted 4 lines · David Woodhouse
Quoted 3 lines · Erik Mouw

File level encryption gives an attacker information about the files on your system.

Quoted 8 lines
Quoted 6 lines

Suppose I can get hold of your disk and I want to know if you are subscribed to linux-kernel. I just mount the disk, and if I find a file called "dwmw2/Mail/linux-kernel", it gives me a large hint you are indeed subscribed. No, I can't decrypt the file, but that wasn't my purpose. I do however know the file metadata, like the filename, the owner, modification time, length, etc.

Not if the metadata were encrypted too.

But I still can see where the metadata lives on the disk, which gives me a hint what kind of filesystem you are using. The more information, the easier the attack.

Quoted 5 lines

You speak only of block-level encryption and of file-level (i.e. application-based) encryption. But don't forget that there's a layer _between_ the applications and the block device. :)

My question was what's wrong with doing encryption in the file system?

If you want to encrypt files, you have to do it right. Any information can lead to a possible compromise of the system, so the best is to hide everything, which can only be done by block level encryption.

Erik

Signature · 2 lines
J.A.K. (Erik) Mouw
Email: [email protected]  [email protected]
#11 lore raw
In reply to Erik Mouw
Quoted 8 lines · Erik Mouw

The way to solve this is to encrypt at the block level. In that way I can't even mount the filesystem when I don't have the correct key, so I can't get to the file metadata. Sure, I could guess you're using ext3, but that still leaves too many uncertainties (like directory layout and filesystem usage) for an attacker to be able to crack your key. A brute force attack will succeed (maybe not in the estimated lifetime of the universe), but it's a lot harder than a brute force known plain text attack.

It mostly adds a level of difficulty, you can try to break it based on expected filesystem types and expected known values for these filesystems. f.i. ext2 has a reserved inodes, on a relatively fresh install there may be several blocks with only initialized inodes scattered across the disk. Copies of the superblock. Unknown, but identical plaintext at different locations on disk, this way you can derive if there is some kind of permutation of the key based on the block/offset within the disk.

MSDOS/VFAT or other filesystems without holes will have a lot of blocks filled with zeros. And every filesystem has some redundancy which is used during fsck, this redundancy is a possible point of attack.

The biggest disadvantage of a block level encryption is that you would have one key for everything and all users can either access the filesystem or not. With file level encryption each file can be encrypted with a unique (per user or group) key.

Oh, and there is no reason for the filesystem to give you access to pathnames or file attributes, directory data could be encrypted just as well and accessible for specific users only.

Jan

#12 lore raw
In reply to Rajaram Suresh Gaunker
Quoted 7 lines

i've copied the ext2 file system code, and changed its name in init function but when i try to mount some fs with the new name it is saying that it is not supporting,

You didn't mention loading the filesystem driver. You did, didn't you? Any error messages (kernel messages) issued?

Before bringing mount into the picture, look at /proc/filesystems. If your new filesystem type name doesn't show up in the list, you're already broken.

--
Bryan Henderson IBM Almaden Research Center
San Jose CA Filesystems