eCryptfs: Do not allocate hash tfm in NORECLAIM context
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 16 Apr 2016 07:01:09 +0000 (15:01 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 20 Apr 2016 09:50:01 +0000 (17:50 +0800)
commite81f3340bba2bdcdf021aff511830e718e6e2112
tree2fce034abb35b8caed6170cb9ebad27cc813f95f
parentb3ab30a7cbdaf7ba20dddeac252cc0238312fff0
eCryptfs: Do not allocate hash tfm in NORECLAIM context

You cannot allocate crypto tfm objects in NORECLAIM or NOFS contexts.
The ecryptfs code currently does exactly that for the MD5 tfm.

This patch fixes it by preallocating the MD5 tfm in a safe context.

The MD5 tfm is also reentrant so this patch removes the superfluous
cs_hash_tfm_mutex.

Reported-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
fs/ecryptfs/crypto.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/inode.c
fs/ecryptfs/super.c