mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Willy Tarreau <w@1wt.eu>
Subject: [PATCH 3.10 008/319] crypto: shash - Fix has_key setting
Date: Sun,  5 Feb 2017 20:09:12 +0100	[thread overview]
Message-ID: <1486322063-7558-9-git-send-email-w@1wt.eu> (raw)
In-Reply-To: <1486322063-7558-1-git-send-email-w@1wt.eu>

From: Herbert Xu <herbert@gondor.apana.org.au>

commit 00420a65fa2beb3206090ead86942484df2275f3 upstream.

The has_key logic is wrong for shash algorithms as they always
have a setkey function.  So we should instead be testing against
shash_no_setkey.

Fixes: a5596d633278 ("crypto: hash - Add crypto_ahash_has_setkey")
Cc: stable@vger.kernel.org
Reported-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 crypto/shash.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/crypto/shash.c b/crypto/shash.c
index 8e4256a..ac4d763 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -353,11 +353,10 @@ int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
 	crt->final = shash_async_final;
 	crt->finup = shash_async_finup;
 	crt->digest = shash_async_digest;
+	crt->setkey = shash_async_setkey;
+
+	crt->has_setkey = alg->setkey != shash_no_setkey;
 
-	if (alg->setkey) {
-		crt->setkey = shash_async_setkey;
-		crt->has_setkey = true;
-	}
 	if (alg->export)
 		crt->export = shash_async_export;
 	if (alg->import)
-- 
2.8.0.rc2.1.gbe9624a

  parent reply	other threads:[~2017-02-05 19:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-05 19:09 [PATCH 3.10 000/319] 3.10.105-stable review Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 001/319] sched/core: Fix a race between try_to_wake_up() and a woken up task Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 002/319] sched/core: Fix an SMP ordering race in try_to_wake_up() vs. schedule() Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 003/319] crypto: algif_skcipher - Require setkey before accept(2) Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 004/319] crypto: af_alg - Disallow bind/setkey/... after accept(2) Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 005/319] crypto: af_alg - Add nokey compatibility path Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 006/319] crypto: algif_skcipher " Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 007/319] crypto: hash - Add crypto_ahash_has_setkey Willy Tarreau
2017-02-05 19:09 ` Willy Tarreau [this message]
2017-02-05 19:09 ` [PATCH 3.10 009/319] crypto: algif_hash - Require setkey before accept(2) Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 010/319] crypto: skcipher - Add crypto_skcipher_has_setkey Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 011/319] crypto: algif_skcipher - Add key check exception for cipher_null Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 012/319] crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 013/319] crypto: algif_hash - Remove custom release parent function Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 014/319] crypto: algif_skcipher " Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 015/319] crypto: af_alg - Forbid bind(2) when nokey child sockets are present Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 016/319] crypto: algif_hash - Fix race condition in hash_check_key Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 017/319] crypto: algif_skcipher - Fix race condition in skcipher_check_key Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 018/319] crypto: algif_skcipher - Load TX SG list after waiting Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 019/319] crypto: cryptd - initialize child shash_desc on import Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 020/319] crypto: skcipher - Fix blkcipher walk OOM crash Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 021/319] crypto: gcm - Fix IV buffer size in crypto_gcm_setkey Willy Tarreau
2017-02-05 19:09 ` [PATCH 3.10 022/319] MIPS: KVM: Fix unused variable build warning Willy Tarreau
2017-02-06  3:12 ` [PATCH 3.10 000/319] 3.10.105-stable review Guenter Roeck
2017-02-06  6:30   ` Willy Tarreau
2017-02-06  8:13 ` Willy Tarreau
2017-02-06 14:46   ` Guenter Roeck
2017-02-06 15:10     ` Willy Tarreau
2017-02-06 22:48     ` Willy Tarreau
2017-02-06 23:48       ` Guenter Roeck
2017-02-07  4:56       ` Guenter Roeck
2017-02-07  6:39         ` Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486322063-7558-9-git-send-email-w@1wt.eu \
    --to=w@1wt.eu \
    --cc=aryabinin@virtuozzo.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®