Thread (12 messages) 12 messages, 3 authors, 2017-11-01

RE: Using the aesni generic gcm(aes) aead in atomic context

From: Ilya Lesokhin <hidden>
Date: 2017-10-31 07:14:15

On Mon Tuesday, October 31, 2017 6:10 AM, Herbert Xu wrote:
Are you allocating the tfm from atomic context? That is not allowed.

Normally you would allocate the tfm in process context, e.g., when the
connection is setup.
I call crypto_alloc_aead("gcm(aes)", 0, flags) in process context.
and aead_request_set_tfm(aead_req, aead) in atomic context.
I'm assuming by tfm you are referring to the struct crypto_aead allocated in the first call I mentioned.

I was able to resolve the  "sleeping function called from invalid context" issue
By clearing the CRYPTO_TFM_REQ_MAY_SLEEP flag using 
aead_request_set_callback with flags = 0.

However I'm still concerned about the lack of irq_fpu_usable() check.
and I don't really want to do the check myself outside of the crypto code as it is
arch specific.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help