aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2016-09-22 16:31:48 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2016-09-30 20:34:28 -0400
commitef68bf119788be4b468aa6d72362c8c5bbc3e073 (patch)
treed5b18da5610e05c5747ee4407eb00171f0d129d9
parentd41065e20484c53d8976742367bb78ac248fb0d5 (diff)
f2fs: 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: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/namei.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index bfcd9da9c2eb..300aef8a2d5f 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -1015,7 +1015,6 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
1015 struct fscrypt_str cstr = FSTR_INIT(NULL, 0); 1015 struct fscrypt_str cstr = FSTR_INIT(NULL, 0);
1016 struct fscrypt_str pstr = FSTR_INIT(NULL, 0); 1016 struct fscrypt_str pstr = FSTR_INIT(NULL, 0);
1017 struct fscrypt_symlink_data *sd; 1017 struct fscrypt_symlink_data *sd;
1018 loff_t size = min_t(loff_t, i_size_read(inode), PAGE_SIZE - 1);
1019 u32 max_size = inode->i_sb->s_blocksize; 1018 u32 max_size = inode->i_sb->s_blocksize;
1020 int res; 1019 int res;
1021 1020
@@ -1030,7 +1029,6 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
1030 if (IS_ERR(cpage)) 1029 if (IS_ERR(cpage))
1031 return ERR_CAST(cpage); 1030 return ERR_CAST(cpage);
1032 caddr = page_address(cpage); 1031 caddr = page_address(cpage);
1033 caddr[size] = 0;
1034 1032
1035 /* Symlink is encrypted */ 1033 /* Symlink is encrypted */
1036 sd = (struct fscrypt_symlink_data *)caddr; 1034 sd = (struct fscrypt_symlink_data *)caddr;