public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* crypto ahash requests on the stack
@ 2025-08-25 14:23 Mikulas Patocka
  2025-08-27  9:36 ` Herbert Xu
  2025-09-09 14:01 ` Harald Freudenberger
  0 siblings, 2 replies; 5+ messages in thread
From: Mikulas Patocka @ 2025-08-25 14:23 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: Harald Freudenberger, linux-crypto, dm-devel

Hi

I'd like to ask about this condition in crypto_ahash_digest:
	if (ahash_req_on_stack(req) && ahash_is_async(tfm))
		return -EAGAIN;

Can it be removed? Or, is there some reason why you can't have 
asynchronous requests on the stack (such as inability of doing DMA to 
virtually mapped stack)?

Or, should I just clear the flag CRYPTO_TFM_REQ_ON_STACK in my code?

I'm modifying dm-integrity to use asynchronous API so that Harald 
Freudenberger can use it on mainframes (the reason is that his 
implementation only provides asynchronous API) and I would prefer to place 
ahash requests on the stack (and wait for them before the function exits).

The commit 04bfa4c7d5119ca38f8133bfdae7957a60c8b221 says that we should 
clone the request with HASH_REQUEST_CLONE, but that is not usable in 
dm-integrity, because dm-integrity must work even when the system is out 
of memory.

Mikulas


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

end of thread, other threads:[~2025-09-11  4:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 14:23 crypto ahash requests on the stack Mikulas Patocka
2025-08-27  9:36 ` Herbert Xu
2025-09-01 12:04   ` Mikulas Patocka
2025-09-09 14:01 ` Harald Freudenberger
2025-09-11  4:46   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox