Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@odin.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	<linux-crypto@vger.kernel.org>
Cc: Andrey Ryabinin <aryabinin@odin.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	<x86@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86/crypto/ghash-intel: specify context size for ghash async algorithm
Date: Thu, 3 Sep 2015 14:32:01 +0300	[thread overview]
Message-ID: <1441279921-26838-2-git-send-email-aryabinin@odin.com> (raw)
In-Reply-To: <1441279921-26838-1-git-send-email-aryabinin@odin.com>

Currently context size (cra_ctxsize) doesn't specified for
ghash_async_alg. Which means it's zero. Thus crypto_create_tfm()
doesn't allocate needed space for ghash_async_ctx, so any
read/write to ctx (e.g. in ghash_async_init_tfm()) is not valid.

Signed-off-by: Andrey Ryabinin <aryabinin@odin.com>
---
 arch/x86/crypto/ghash-clmulni-intel_glue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c
index 64d7cf1..440df0c 100644
--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c
+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
@@ -294,6 +294,7 @@ static struct ahash_alg ghash_async_alg = {
 			.cra_name		= "ghash",
 			.cra_driver_name	= "ghash-clmulni",
 			.cra_priority		= 400,
+			.cra_ctxsize		= sizeof(struct ghash_async_ctx),
 			.cra_flags		= CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC,
 			.cra_blocksize		= GHASH_BLOCK_SIZE,
 			.cra_type		= &crypto_ahash_type,
-- 
2.4.6

  reply	other threads:[~2015-09-03 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 11:32 [PATCH] crypto/testmgr: don't copy from source IV too much Andrey Ryabinin
2015-09-03 11:32 ` Andrey Ryabinin [this message]
2015-09-04 15:24   ` [PATCH] x86/crypto/ghash-intel: specify context size for ghash async algorithm Herbert Xu
2015-09-03 13:20 ` [PATCH] crypto/testmgr: don't copy from source IV too much Herbert Xu
2015-09-04 16:42   ` Andrey Ryabinin
2015-09-05  2:04     ` Herbert Xu
2015-09-10 10:11   ` [PATCH v2] " Andrey Ryabinin
2015-09-11 14:14     ` Herbert Xu

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=1441279921-26838-2-git-send-email-aryabinin@odin.com \
    --to=aryabinin@odin.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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