add patch create-function-to-read-journal-inode
[ext4-patch-queue.git] / do-not-null-terminate-encrypted-symlink-data
blob001508937b90ad8be7defe4d7a5afee395d0c3f0
1 ext4: do not unnecessarily null-terminate encrypted symlink data
3 From: Eric Biggers <ebiggers@google.com>
5 Null-terminating the fscrypt_symlink_data on read is unnecessary because
6 it is not string data --- it contains binary ciphertext.
8 Signed-off-by: Eric Biggers <ebiggers@google.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 ---
11  fs/ext4/symlink.c | 2 --
12  1 file changed, 2 deletions(-)
14 diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
15 index 0a26cbd..fdf1c61 100644
16 --- a/fs/ext4/symlink.c
17 +++ b/fs/ext4/symlink.c
18 @@ -30,7 +30,6 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,
19         char *caddr, *paddr = NULL;
20         struct fscrypt_str cstr, pstr;
21         struct fscrypt_symlink_data *sd;
22 -       loff_t size = min_t(loff_t, i_size_read(inode), PAGE_SIZE - 1);
23         int res;
24         u32 max_size = inode->i_sb->s_blocksize;
26 @@ -49,7 +48,6 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,
27                 if (IS_ERR(cpage))
28                         return ERR_CAST(cpage);
29                 caddr = page_address(cpage);
30 -               caddr[size] = 0;
31         }
33         /* Symlink is encrypted */
34 -- 
35 2.8.0.rc3.226.g39d4020
38 To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
39 the body of a message to majordomo@vger.kernel.org
40 More majordomo info at  http://vger.kernel.org/majordomo-info.html