summaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/crypto.c
diff options
context:
space:
mode:
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>2011-02-23 00:14:19 -0600
committerTyler Hicks <tyhicks@linux.vnet.ibm.com>2011-03-28 01:47:43 -0500
commitbd4f0fe8bb7c73c738e1e11bc90d6e2cf9c6e20e (patch)
treecaa1915ec444bbdb52a1646274d73e733979bb44 /fs/ecryptfs/crypto.c
parent40471856f2e38e9bfa8d605295e8234421110dd6 (diff)
downloadlinux-bd4f0fe8bb7c73c738e1e11bc90d6e2cf9c6e20e.tar.gz
linux-bd4f0fe8bb7c73c738e1e11bc90d6e2cf9c6e20e.tar.bz2
linux-bd4f0fe8bb7c73c738e1e11bc90d6e2cf9c6e20e.zip
eCryptfs: Remove unnecessary grow_file() function
When creating a new eCryptfs file, the crypto metadata is written out and then the lower file was being "grown" with 4 kB of encrypted zeroes. I suspect that growing the encrypted file was to prevent an information leak that the unencrypted file was empty. However, the unencrypted file size is stored, in plaintext, in the metadata so growing the file is unnecessary. Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r--fs/ecryptfs/crypto.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index bfd8b680e648..98a2a314ea68 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1389,6 +1389,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry)
rc = -ENOMEM;
goto out;
}
+ /* Zeroed page ensures the in-header unencrypted i_size is set to 0 */
rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat,
ecryptfs_dentry);
if (unlikely(rc)) {