From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH 5/11] [CRYPTO] chainiv: Add chain IV generator
Date: Thu, 22 Nov 2007 14:17:11 +0300 [thread overview]
Message-ID: <20071122111711.GC2444@2ka.mipt.ru> (raw)
In-Reply-To: <E1Iv7jn-00020S-00@gondolin.me.apana.org.au>
On Thu, Nov 22, 2007 at 04:48:43PM +0800, Herbert Xu (herbert@gondor.apana.org.au) wrote:
> +static int chainiv_givcrypt(struct ablkcipher_request *req)
> +{
> + struct crypto_ablkcipher *geniv = crypto_ablkcipher_reqtfm(req);
> + struct chainiv_ctx *ctx = crypto_ablkcipher_ctx(geniv);
> + struct ablkcipher_request *subreq = ablkcipher_request_ctx(req);
> + unsigned int ivsize;
> + int err;
> +
> + ablkcipher_request_set_tfm(subreq, ctx->cipher);
> + ablkcipher_request_set_callback(subreq, req->base.flags &
> + ~CRYPTO_TFM_REQ_MAY_SLEEP,
> + req->base.complete, req->base.data);
> + ablkcipher_request_set_crypt(subreq, req->src, req->dst, req->nbytes,
> + req->info);
> +
> + spin_lock_bh(&ctx->lock);
Crypto hardware can access iv in interrupt context and thus this can get
wrong data.
> + ivsize = crypto_ablkcipher_ivsize(geniv);
> +
> + memcpy(req->giv, ctx->iv, ivsize);
> + memcpy(req->info, ctx->iv, ivsize);
> +
> + err = crypto_ablkcipher_encrypt(subreq);
> + if (err)
> + goto unlock;
Are you sure that crypto operation has to be limited to be performed
with turned off bottom halves? I believe this is a huge limitation for
those ablkcipher devices which are not async actually...
--
Evgeniy Polyakov
next prev parent reply other threads:[~2007-11-22 11:17 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-22 8:47 [0/11] Add IV generators and givcrypt Herbert Xu
2007-11-22 8:48 ` [PATCH 1/11] [CRYPTO] ablkcipher: Add givcrypt operation and givcipher type Herbert Xu
2007-11-22 8:48 ` [PATCH 2/11] [CRYPTO] cryptd: Use geniv of the underlying algorithm Herbert Xu
2007-11-22 8:48 ` [PATCH 3/11] [CRYPTO] blkcipher: Merge ablkcipher and blkcipher into one option/module Herbert Xu
2007-11-22 11:18 ` Evgeniy Polyakov
2007-11-22 11:28 ` Herbert Xu
2007-11-22 11:48 ` Evgeniy Polyakov
2007-11-22 8:48 ` [PATCH 4/11] [CRYPTO] blkcipher: Add givcipher_alloc_inst/givcipher_free_inst Herbert Xu
2007-11-22 8:48 ` [PATCH 5/11] [CRYPTO] chainiv: Add chain IV generator Herbert Xu
2007-11-22 11:17 ` Evgeniy Polyakov [this message]
2007-11-22 11:26 ` Herbert Xu
2007-11-22 12:05 ` Evgeniy Polyakov
2007-11-22 12:12 ` Herbert Xu
2007-11-25 12:31 ` Herbert Xu
2007-11-25 12:58 ` Herbert Xu
2007-11-26 11:54 ` Evgeniy Polyakov
2007-11-22 8:48 ` [PATCH 6/11] [CRYPTO] ablkcipher: Added ablkcipher_request_complete Herbert Xu
2007-11-22 8:48 ` [PATCH 7/11] [CRYPTO] eseqiv: Add Encrypted Sequence Number IV Generator Herbert Xu
2007-11-22 8:48 ` [PATCH 8/11] [CRYPTO] blkcipher: Create default givcipher instances Herbert Xu
2007-11-22 8:48 ` [PATCH 9/11] [CRYPTO] seqiv: Add Sequence Number IV Generator Herbert Xu
2007-11-22 8:49 ` [PATCH 10/11] [CRYPTO] aead: Add givcrypt operation Herbert Xu
2007-11-22 15:51 ` Herbert Xu
2007-11-22 8:49 ` [PATCH 11/11] [CRYPTO] authenc: " Herbert Xu
2007-11-23 11:24 ` Herbert Xu
2007-11-22 11:25 ` [0/11] Add IV generators and givcrypt Evgeniy Polyakov
2007-11-22 11:31 ` Herbert Xu
2007-11-22 11:57 ` Evgeniy Polyakov
2007-11-22 12:09 ` Herbert Xu
2007-11-22 12:37 ` Evgeniy Polyakov
2007-11-22 12:47 ` 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=20071122111711.GC2444@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@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