]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: algif_hash - Require setkey before accept(2)
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Jan 2016 13:31:04 +0000 (21:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:35 +0000 (14:28 -0800)
commit1a2a01e2ca4e656e64cc1d65ea7950751d04573e
tree20e846eeb7a33f5d51b971f1aaf1ce91f9548e53
parent0859efc0b4488bb10cc46466d91a01aeb802ea3f
crypto: algif_hash - Require setkey before accept(2)

commit 6de62f15b581f920ade22d758f4c338311c2f0d4 upstream.

Hash implementations that require a key may crash if you use
them without setting a key.  This patch adds the necessary checks
so that if you do attempt to use them without a key that we return
-ENOKEY instead of proceeding.

This patch also adds a compatibility path to support old applications
that do acept(2) before setkey.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/algif_hash.c