diff options
author | Eric Biggers <ebiggers@google.com> | 2018-04-30 15:51:42 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-05-20 16:21:02 -0400 |
commit | 54632f02d0cc4e47e20d0d742bf162021801fa9a (patch) | |
tree | cad33d798d5bbe81893afa35a995fa88eda7a6a6 /fs/crypto | |
parent | 17bfde6097bd5c6b8eb7474f8f75a4b95d091558 (diff) | |
download | linux-54632f02d0cc4e47e20d0d742bf162021801fa9a.tar.gz linux-54632f02d0cc4e47e20d0d742bf162021801fa9a.tar.bz2 linux-54632f02d0cc4e47e20d0d742bf162021801fa9a.zip |
fscrypt: drop max_namelen check from fname_decrypt()
fname_decrypt() returns an error if the input filename is longer than
the inode's ->max_namelen() as given by the filesystem. But, this
doesn't actually make sense because the filesystem provided the input
filename in the first place, where it was subject to the filesystem's
limits. And fname_decrypt() has no internal limit itself.
Thus, remove this unnecessary check.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/crypto')
-rw-r--r-- | fs/crypto/fname.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index 8088a606c0aa..cc9590b5f371 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -93,14 +93,11 @@ static int fname_decrypt(struct inode *inode, struct skcipher_request *req = NULL; DECLARE_CRYPTO_WAIT(wait); struct scatterlist src_sg, dst_sg; - struct fscrypt_info *ci = inode->i_crypt_info; - struct crypto_skcipher *tfm = ci->ci_ctfm; + struct crypto_skcipher *tfm = inode->i_crypt_info->ci_ctfm; int res = 0; char iv[FS_CRYPTO_BLOCK_SIZE]; - unsigned lim; - lim = inode->i_sb->s_cop->max_namelen(inode); - if (iname->len <= 0 || iname->len > lim) + if (iname->len <= 0) return -EIO; /* Allocate request */ |