ext4 crypto: add padding to filenames before encrypting
authorTheodore Ts'o <tytso@google.com>
Wed, 29 Apr 2015 16:13:02 +0000 (12:13 -0400)
committerIan Chang <ianc@nvidia.com>
Wed, 1 Jun 2016 05:00:02 +0000 (13:00 +0800)
commit4884446dd6d1a458095efd5a3748dd240cd3a4a3
treeb7520b9abf1d23928d808d26b783145aa53cae61
parenta8301a06146154356cb85fe7f5b9abcc55477165
ext4 crypto: add padding to filenames before encrypting

This obscures the length of the filenames, to decrease the amount of
information leakage.  By default, we pad the filenames to the next 4
byte boundaries.  This costs nothing, since the directory entries are
aligned to 4 byte boundaries anyway.  Filenames can also be padded to
8, 16, or 32 bytes, which will consume more directory space.

Change-Id: I2d4ab2b76797ab93fada683f405e3876e0cff9dc
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Theodore Ts'o <tytso@google.com>
fs/ext4/crypto_fname.c
fs/ext4/crypto_key.c
fs/ext4/crypto_policy.c
fs/ext4/ext4.h
fs/ext4/ext4_crypto.h