]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:05:55 +0000 (08:05 -0500)
commit1a1b26dbd57febd182e141277a12dfcbfadfa135
tree7744b19d5ce7d552c254a358be00b1dd0247f63a
parentf3f32cb8d66d8d54ce3bab37d92ca646bfbaf233
crypto: skcipher - Fix blkcipher walk OOM crash

BugLink: http://bugs.launchpad.net/bugs/1629386
commit acdb04d0b36769b3e05990c488dc74d8b7ac8060 upstream.

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")
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
crypto/blkcipher.c