diff options
author | Tyler Hicks <tyhicks@linux.vnet.ibm.com> | 2009-03-13 16:51:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-14 14:57:22 -0400 |
commit | 84814d642a4f1f294bd675ab11aae1ca54c6cedb (patch) | |
tree | 4ae91cce54c8d9578dc3217b6454a921b91833a3 /fs/ecryptfs/ecryptfs_kernel.h | |
parent | 15e7b8767605dc0cb9bd4594caabfec392385210 (diff) |
eCryptfs: don't encrypt file key with filename key
eCryptfs has file encryption keys (FEK), file encryption key encryption
keys (FEKEK), and filename encryption keys (FNEK). The per-file FEK is
encrypted with one or more FEKEKs and stored in the header of the
encrypted file. I noticed that the FEK is also being encrypted by the
FNEK. This is a problem if a user wants to use a different FNEK than
their FEKEK, as their file contents will still be accessible with the
FNEK.
This is a minimalistic patch which prevents the FNEKs signatures from
being copied to the inode signatures list. Ultimately, it keeps the FEK
from being encrypted with a FNEK.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Acked-by: Dustin Kirkland <kirkland@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/ecryptfs_kernel.h')
-rw-r--r-- | fs/ecryptfs/ecryptfs_kernel.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index c11fc95714ab..eb2267eca1fe 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -328,6 +328,7 @@ struct ecryptfs_dentry_info { | |||
328 | */ | 328 | */ |
329 | struct ecryptfs_global_auth_tok { | 329 | struct ecryptfs_global_auth_tok { |
330 | #define ECRYPTFS_AUTH_TOK_INVALID 0x00000001 | 330 | #define ECRYPTFS_AUTH_TOK_INVALID 0x00000001 |
331 | #define ECRYPTFS_AUTH_TOK_FNEK 0x00000002 | ||
331 | u32 flags; | 332 | u32 flags; |
332 | struct list_head mount_crypt_stat_list; | 333 | struct list_head mount_crypt_stat_list; |
333 | struct key *global_auth_tok_key; | 334 | struct key *global_auth_tok_key; |
@@ -696,7 +697,7 @@ ecryptfs_write_header_metadata(char *virt, | |||
696 | int ecryptfs_add_keysig(struct ecryptfs_crypt_stat *crypt_stat, char *sig); | 697 | int ecryptfs_add_keysig(struct ecryptfs_crypt_stat *crypt_stat, char *sig); |
697 | int | 698 | int |
698 | ecryptfs_add_global_auth_tok(struct ecryptfs_mount_crypt_stat *mount_crypt_stat, | 699 | ecryptfs_add_global_auth_tok(struct ecryptfs_mount_crypt_stat *mount_crypt_stat, |
699 | char *sig); | 700 | char *sig, u32 global_auth_tok_flags); |
700 | int ecryptfs_get_global_auth_tok_for_sig( | 701 | int ecryptfs_get_global_auth_tok_for_sig( |
701 | struct ecryptfs_global_auth_tok **global_auth_tok, | 702 | struct ecryptfs_global_auth_tok **global_auth_tok, |
702 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat, char *sig); | 703 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat, char *sig); |