diff options
author | Eric Biggers <ebiggers@google.com> | 2016-09-30 01:44:17 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-09-30 01:44:17 -0400 |
commit | cc91542ac8f29d8446ef59234796b95f0fbce09a (patch) | |
tree | 742741c73d8ec48e8950f870ce6497786e82fdc3 /fs/ext4 | |
parent | e81d44778d1d57bbaef9e24c4eac7c8a7a401d40 (diff) |
ext4: do not unnecessarily null-terminate encrypted symlink data
Null-terminating the fscrypt_symlink_data on read is unnecessary because
it is not string data --- it contains binary ciphertext.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/symlink.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c index 0a26cbd529c8..fdf1c6154745 100644 --- a/fs/ext4/symlink.c +++ b/fs/ext4/symlink.c | |||
@@ -30,7 +30,6 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry, | |||
30 | char *caddr, *paddr = NULL; | 30 | char *caddr, *paddr = NULL; |
31 | struct fscrypt_str cstr, pstr; | 31 | struct fscrypt_str cstr, pstr; |
32 | struct fscrypt_symlink_data *sd; | 32 | struct fscrypt_symlink_data *sd; |
33 | loff_t size = min_t(loff_t, i_size_read(inode), PAGE_SIZE - 1); | ||
34 | int res; | 33 | int res; |
35 | u32 max_size = inode->i_sb->s_blocksize; | 34 | u32 max_size = inode->i_sb->s_blocksize; |
36 | 35 | ||
@@ -49,7 +48,6 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry, | |||
49 | if (IS_ERR(cpage)) | 48 | if (IS_ERR(cpage)) |
50 | return ERR_CAST(cpage); | 49 | return ERR_CAST(cpage); |
51 | caddr = page_address(cpage); | 50 | caddr = page_address(cpage); |
52 | caddr[size] = 0; | ||
53 | } | 51 | } |
54 | 52 | ||
55 | /* Symlink is encrypted */ | 53 | /* Symlink is encrypted */ |