2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 13:43:55 +08:00
linux-next/fs/crypto
Eric Biggers 0f0909e242 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-19 20:56:13 -05:00
..
crypto.c fscrypto: make XTS tweak initialization endian-independent 2016-10-12 23:30:16 -04:00
fname.c fscrypto: don't use on-stack buffer for filename encryption 2016-11-19 20:56:06 -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-19 20:56:13 -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