All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: relocate ALG_MAX_PAGES to uapi
@ 2015-12-25 17:14 Stephan Mueller
  2016-01-08 12:51 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Mueller @ 2015-12-25 17:14 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto

The define of ALG_MAX_PAGES is relevant for user space as this macro
defines the maximum number of pages to be processed in one go by
vmsplice/splice. If user space does not obey that limit, the calling
thread will hang until a recvmsg is called (by another thread).

As user space should have the ability to prevent such blocks, it needs
to know about the limit. Therefore, the define is moved to the uapi
header file.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 include/crypto/if_alg.h     | 2 --
 include/uapi/linux/if_alg.h | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 018afb2..fb00376 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -20,8 +20,6 @@
 #include <linux/types.h>
 #include <net/sock.h>
 
-#define ALG_MAX_PAGES			16
-
 struct crypto_async_request;
 
 struct alg_sock {
diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h
index f2acd2f..96af72f 100644
--- a/include/uapi/linux/if_alg.h
+++ b/include/uapi/linux/if_alg.h
@@ -39,4 +39,7 @@ struct af_alg_iv {
 #define ALG_OP_DECRYPT			0
 #define ALG_OP_ENCRYPT			1
 
+/* Maximum number of pages to be processed */
+#define ALG_MAX_PAGES			16
+
 #endif	/* _LINUX_IF_ALG_H */
-- 
2.5.0

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

* Re: [PATCH] crypto: relocate ALG_MAX_PAGES to uapi
  2015-12-25 17:14 [PATCH] crypto: relocate ALG_MAX_PAGES to uapi Stephan Mueller
@ 2016-01-08 12:51 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2016-01-08 12:51 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: linux-crypto

On Fri, Dec 25, 2015 at 06:14:54PM +0100, Stephan Mueller wrote:
> The define of ALG_MAX_PAGES is relevant for user space as this macro
> defines the maximum number of pages to be processed in one go by
> vmsplice/splice. If user space does not obey that limit, the calling
> thread will hang until a recvmsg is called (by another thread).
> 
> As user space should have the ability to prevent such blocks, it needs
> to know about the limit. Therefore, the define is moved to the uapi
> header file.
> 
> Signed-off-by: Stephan Mueller <smueller@chronox.de>

I don't like exporting details like this.  User-space should not
be relying on voodoo like this to avoid hanging.

Please show me the program that actually hangs so we can figure
out what if anything needs to be done to address this.

Thanks,
-- 
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

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

end of thread, other threads:[~2016-01-08 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-25 17:14 [PATCH] crypto: relocate ALG_MAX_PAGES to uapi Stephan Mueller
2016-01-08 12:51 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.