kernel_optimize_test/fs/crypto
Eric Biggers a6e0891286 fscrypto: don't use on-stack buffer for key derivation
With the new (in 4.9) option to use a virtually-mapped stack
(CONFIG_VMAP_STACK), stack buffers cannot be used as input/output for
the scatterlist crypto API because they may not be directly mappable to
struct page.  get_crypt_info() was using a stack buffer to hold the
output from the encryption operation used to derive the per-file key.
Fix it by using a heap buffer.

This bug could most easily be observed in a CONFIG_DEBUG_SG kernel
because this allowed the BUG in sg_set_buf() to be triggered.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-11-13 21:56:25 -05:00
..
crypto.c fscrypt: Let fs select encryption index/tweak 2016-11-13 20:18:16 -05:00
fname.c fscrypto: don't use on-stack buffer for filename encryption 2016-11-13 21:56:19 -05:00
Kconfig fs crypto: move per-file encryption from f2fs tree to fs/crypto 2016-03-17 21:19:33 -07:00
keyinfo.c fscrypto: don't use on-stack buffer for key derivation 2016-11-13 21:56:25 -05:00
Makefile fs crypto: move per-file encryption from f2fs tree to fs/crypto 2016-03-17 21:19:33 -07:00
policy.c fscrypto: lock inode while setting encryption policy 2016-10-15 09:48:50 -04:00