]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: skcipher - Fix blkcipher walk OOM crash
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 13 Sep 2016 06:43:29 +0000 (14:43 +0800)
committerTodd Vierling <todd.vierling@oracle.com>
Fri, 9 Dec 2016 14:47:44 +0000 (09:47 -0500)
commit53996ec5ce2dff945154429b747b1b8488ed834c
treeb5a82c9df84bb2e557edc542da9a6e7b0d53fd5b
parentec38bd330c53c64ab319140523df1ec5d88a7c8f
crypto: skcipher - Fix blkcipher walk OOM crash

[ Upstream commit acdb04d0b36769b3e05990c488dc74d8b7ac8060 ]

When we need to allocate a temporary blkcipher_walk_next and it
fails, the code is supposed to take the slow path of processing
the data block by block.  However, due to an unrelated change
we instead end up dereferencing the NULL pointer.

This patch fixes it by moving the unrelated bsize setting out
of the way so that we enter the slow path as inteded.

Fixes: 7607bd8ff03b ("[CRYPTO] blkcipher: Added blkcipher_walk_virt_block")
Cc: stable@vger.kernel.org
Reported-by: xiakaixu <xiakaixu@huawei.com>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
(cherry picked from commit a55614f1d6e3299837301b0e0a8599c3463db6bd)
Signed-off-by: Todd Vierling <todd.vierling@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
crypto/blkcipher.c