]> git.baikalelectronics.ru Git - kernel.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)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 7 Oct 2017 04:04:32 +0000 (12:04 +0800)
commit29c3b5237b2f0334c41deda44048b6450b1aac26
tree6d612f29ee44e877b4fb546898f729f135ac9900
parent9f30086f47adadbaf2c137e484a9b01223685aaa
crypto: skcipher - Fix crash on zero-length input

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: 737af8fc0c4a ("crypto: skcipher - Add skcipher walk...")
Cc: <stable@vger.kernel.org>
Reported-by: Stephan Müller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/skcipher.c