]> git.baikalelectronics.ru Git - kernel.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)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 13 Sep 2016 10:44:57 +0000 (18:44 +0800)
commitd888f350bf98206a6a7d8603dc2674833ce673f8
tree929bde16dc4aa075f378f43a923dfa3dfe6aaefd
parent9df93a93a23cec7596585213c3727000f2ab378b
crypto: skcipher - Fix blkcipher walk OOM crash

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: 7976995e9cb6 ("[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>
crypto/blkcipher.c