dm integrity: don't store cipher request on the stack
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 10 Jan 2018 14:32:47 +0000 (09:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jan 2018 18:58:19 +0000 (19:58 +0100)
commitc808f1db59561a65c27cb4ffb8515b95e33af221
tree752cb419a24fc3bdddd99a14416a70234b70e076
parent5f12c33849404e20b24914a5f112ffbb9f8c35b0
dm integrity: don't store cipher request on the stack

commit 717f4b1c52135f279112df82583e0c77e80f90de upstream.

Some asynchronous cipher implementations may use DMA.  The stack may
be mapped in the vmalloc area that doesn't support DMA.  Therefore,
the cipher request and initialization vector shouldn't be on the
stack.

Fix this by allocating the request and iv with kmalloc.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-integrity.c