]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: skcipher - Fix crash on zero-length input
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 7 Oct 2017 03:29:48 +0000 (11:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Oct 2017 07:38:28 +0000 (09:38 +0200)
commit9ace51c5b4796927909be31e231fd7780c988382
treeee85eb3bf65d3f1f5ed6608543083ac72650cc38
parent984154e7eef1f9e543dabd7422cfc99015778732
crypto: skcipher - Fix crash on zero-length input

commit 0cabf2af6f5ac3c88cb106c4e06087a5a39b8e1e upstream.

The skcipher walk interface doesn't handle zero-length input
properly as the old blkcipher walk interface did.  This is due
to the fact that the length check is done too late.

This patch moves the length check forward so that it does the
right thing.

Fixes: b286d8b1a690 ("crypto: skcipher - Add skcipher walk...")
Reported-by: Stephan Müller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/skcipher.c