From: Eric Biggers Date: Mon, 30 Apr 2018 22:51:43 +0000 (-0700) Subject: fscrypt: drop empty name check from fname_decrypt() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0c4cdb27caa40167a7369a986afcde3d1d913b06;p=linux.git fscrypt: drop empty name check from fname_decrypt() fname_decrypt() is validating that the encrypted filename is nonempty. However, earlier a stronger precondition was already enforced: the encrypted filename must be at least 16 (FS_CRYPTO_BLOCK_SIZE) bytes. Drop the redundant check for an empty filename. Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o --- diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index cc9590b5f371a..c4eb3a235ae4e 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -97,9 +97,6 @@ static int fname_decrypt(struct inode *inode, int res = 0; char iv[FS_CRYPTO_BLOCK_SIZE]; - if (iname->len <= 0) - return -EIO; - /* Allocate request */ req = skcipher_request_alloc(tfm, GFP_NOFS); if (!req)