ext4 crypto: check for too-short encrypted file names
authorTheodore Ts'o <tytso@mit.edu>
Fri, 17 Jul 2015 15:33:16 +0000 (11:33 -0400)
committerIan Chang <ianc@nvidia.com>
Wed, 1 Jun 2016 05:00:06 +0000 (13:00 +0800)
commit9e59ea9b590e02203d2f0369f257c43c7cec07ee
tree1c1a00981366c255c145f6f91ba5874a29da2cf8
parent8a3a934acdaa7645eac66a4fecd6874355a5208e
ext4 crypto: check for too-short encrypted file names

An encrypted file name should never be shorter than an 16 bytes, the
AES block size.  The 3.10 crypto layer will oops and crash the kernel
if ciphertext shorter than the block size is passed to it.

Fortunately, in modern kernels the crypto layer will not crash the
kernel in this scenario, but nevertheless, it represents a corrupted
directory, and we should detect it and mark the file system as
corrupted so that e2fsck can fix this.

Change-Id: Ic42808e5161b22ff607689d3570be4d04e6158ed
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Theodore Ts'o <tytso@google.com>
Reviewed-on: http://git-master/r/1154515
Reviewed-by: Ian Chang <ianc@nvidia.com>
Tested-by: Ian Chang <ianc@nvidia.com>
fs/ext4/crypto_fname.c