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>
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user