]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:44:22 +0000 (15:44 -0700)
commit1bfa30b9b548c9cee5aee7b0f246a5b705d174e3
tree1447e79a5245a15d361541813bea3cc7ff15386b
parent974a45747e7c6e2b2012769ae7415f7801ed50c2
crypto: algif_hash - Require setkey before accept(2)

Orabug: 23330752

[ Upstream commit 6de62f15b581f920ade22d758f4c338311c2f0d4 ]

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.

Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit e1ed9a4b4380fc33c558a0c1bd7cbf527e891151)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
crypto/algif_hash.c