crypto: algif_skcipher - Require setkey before accept(2)
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Dec 2015 07:40:05 +0000 (15:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:31:02 +0000 (12:31 -0800)
commitb238717c0bb4606e2e36fc0de745306b0c900d83
tree09901af0ecd5e9e3d1bd9e07228cbbabd4774f3a
parenta800cbddbc2042b042491867e96e2f3c5c0d3e3b
crypto: algif_skcipher - Require setkey before accept(2)

commit dd504589577d8e8e70f51f997ad487a4cb6c026f upstream.

Some cipher implementations will crash if you try to use them
without calling setkey first.  This patch adds a check so that
the accept(2) call will fail with -ENOKEY if setkey hasn't been
done on the socket yet.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/algif_skcipher.c