Backport fix for crypto: algif_skcipher - Require setkey before accept(2)
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 26 Feb 2016 11:44:08 +0000 (12:44 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 28 Feb 2016 05:09:44 +0000 (00:09 -0500)
commit762330b161c49c6d88ab689a0ee2a1a959dc5b6b
treefc2aaaefe53d61f77d61bf3cdd39ebc581b1de08
parent09b09ced1e4e3afb2767ee96edc9d1d57fc1c55b
Backport fix for 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.

Cc: stable@vger.kernel.org
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
[backported to 4.1 by Milan Broz <gmazyland@gmail.com>]

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
crypto/algif_skcipher.c