crypto: relocate ALG_MAX_PAGES to uapi
Subsystems (2)
PATCH 1/1 crypto: relocate ALG_MAX_PAGES to uapi
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.
--- include/crypto/if_alg.h | 2 -- include/uapi/linux/if_alg.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-)
include/crypto/if_alg.h +0 -2
@@ -20,8 +20,6 @@#include <linux/types.h> #include <net/sock.h> -#define ALG_MAX_PAGES 16 -struct crypto_async_request ;struct alg_sock {
include/uapi/linux/if_alg.h +3 -0
@@ -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 */
Signature · 1 line
2.5.0
Herbert Xu
maintainerQuoted 10 lines · Stephan Mueller
The define of
ALG_MAX_PAGESis 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 <[email protected]>
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,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt