crypto: algif_skcipher - Require setkey before accept(2)
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 27 Oct 2016 14:29:34 +0000 (17:29 +0300)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 08:04:07 +0000 (09:04 +0100)
commitb886719145be12b36048dffbca07332500c39cf6
tree46b3242a63e66b6f19ffd45c2e3ff63ca8b06d0d
parentc73d76df37ce1fa2d96e6c97e44ba5b4edc8eb7f
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>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
crypto/algif_skcipher.c