cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack
authorAndy Lutomirski <luto@kernel.org>
Mon, 12 Dec 2016 20:54:37 +0000 (12:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2017 09:40:16 +0000 (10:40 +0100)
commit7aa58e7ad53bd9536aa49a18ccd0778c728bf57d
treeaae3c7a3973b84a0361804bc7e31dc13147cdb93
parent41c856b329008609157199552e767a7a02d62cd1
cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack

commit 06deeec77a5a689cc94b21a8a91a76e42176685d upstream.

smbencrypt() points a scatterlist to the stack, which is breaks if
CONFIG_VMAP_STACK=y.

Fix it by switching to crypto_cipher_encrypt_one().  The new code
should be considerably faster as an added benefit.

This code is nearly identical to some code that Eric Biggers
suggested.

Reported-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smbencrypt.c