Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1667512
| From | Herbert Xu <herbert@gondor.apana.org.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 0/2] crypto: caam - fix cts(cbc(aes)) with CAAM driver |
| Date | 2017-06-16 10:10 +0200 |
| Message-ID | <tSUum-5Te-15@gated-at.bofh.it> (permalink) |
| References | <tNTSh-11x-3@gated-at.bofh.it> <tSEpA-3Kz-9@gated-at.bofh.it> <tSUkG-5AJ-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jun 16, 2017 at 07:57:00AM +0000, Horia Geantă wrote:
>
> Commit 0605c41cc53ca ("crypto: cts - Convert to skcipher") appends
> CRYPTO_TFM_REQ_MAY_BACKLOG to the original crypto request flags for the
> last block - when calling cts_cbc_encrypt().
> Is it really needed?
Yes, because at this point we cannot tell the sender to back off.
> For cts(cbc(aes)) with cbc(aes) offloaded in HW, i.e. running in async
> mode, we get the below stack for CAAM driver.
> Driver is told that it can sleep (CRYPTO_TFM_REQ_MAY_BACKLOG flag), so
> it uses GFP_KERNEL to allocate memory. However, this is incorrect, since
> driver runs in atomic context (softirq).
This is wrong. Whether you can sleep or not is determined by
MAY_SLEEP, not MAY_BACKLOG. MAY_BACKLOG only indicates that this
request must be queued, even if the queue is full.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC PATCH 0/2] crypto: caam - fix cts(cbc(aes)) with CAAM driver Horia Geantă <horia.geanta@nxp.com> - 2017-06-15 17:00 +0200
Re: [RFC PATCH 0/2] crypto: caam - fix cts(cbc(aes)) with CAAM driver Horia Geantă <horia.geanta@nxp.com> - 2017-06-16 10:00 +0200
Re: [RFC PATCH 0/2] crypto: caam - fix cts(cbc(aes)) with CAAM driver Herbert Xu <herbert@gondor.apana.org.au> - 2017-06-16 10:10 +0200
Re: [RFC PATCH 0/2] crypto: caam - fix cts(cbc(aes)) with CAAM driver Horia Geantă <horia.geanta@nxp.com> - 2017-06-16 23:10 +0200
Re: [RFC PATCH 0/2] crypto: caam - fix cts(cbc(aes)) with CAAM driver David Gstir <david@sigma-star.at> - 2017-06-17 11:10 +0200
csiph-web