netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using the aesni generic gcm(aes) aead in atomic context
@ 2017-10-30 15:18 Ilya Lesokhin
  2017-10-31  4:10 ` Herbert Xu
  0 siblings, 1 reply; 12+ messages in thread
From: Ilya Lesokhin @ 2017-10-30 15:18 UTC (permalink / raw)
  To: netdev@vger.kernel.org, sd@queasysnail.net,
	herbert@gondor.apana.org.au
  Cc: Boris Pismenny

Hi,
I've tried using the aesni generic gcm(aes) aead to implement TLS SW fallback and
I'm getting 
[ 3356.839506] BUG: sleeping function called from invalid context at ./include/crypto/algapi.h:417

The warning is coming from a ___might_sleep() macro that is called if CRYPTO_TFM_REQ_MAY_SLEEP is set.
I'm getting the warning regardless of if pass CRYPTO_ALG_ASYNC or 0 as flags to crypto_alloc_aead("gcm(aes)", 0, flags).

I've also noticed that rfc4106_encrypt() includes a irq_fpu_usable() check while generic_gcmaes_encrypt() doesn't. 
Is the generic gcm(aes) aead unsafe in atomic context?
And if so which aead should I use?

Finally, out of curiosity, doesn't macsec crypto run in atomic context?

Thanks,
Ilya

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-11-01  9:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-30 15:18 Using the aesni generic gcm(aes) aead in atomic context Ilya Lesokhin
2017-10-31  4:10 ` Herbert Xu
2017-10-31  7:14   ` Ilya Lesokhin
2017-10-31  7:17     ` Herbert Xu
2017-10-31  7:23       ` Ilya Lesokhin
2017-10-31  7:32         ` Herbert Xu
2017-10-31  7:39           ` Ilya Lesokhin
2017-10-31  7:44             ` Herbert Xu
2017-10-31  7:58               ` Ilya Lesokhin
2017-10-31  9:13               ` Steffen Klassert
2017-10-31  9:41                 ` Ilya Lesokhin
2017-11-01  9:21                   ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).