diff options
author | Ondrej Kozina <okozina@redhat.com> | 2014-08-25 05:49:54 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-09-04 03:07:10 -0400 |
commit | e2cffb5f493a8b431dc87124388ea59b79f0bccb (patch) | |
tree | a671bcf66969ac8af41a1b887f061f18bf64c1c2 /crypto | |
parent | ab81873974afa3ce7bd8669580b06d33353f1e7c (diff) |
crypto: algif - avoid excessive use of socket buffer in skcipher
On archs with PAGE_SIZE >= 64 KiB the function skcipher_alloc_sgl()
fails with -ENOMEM no matter what user space actually requested.
This is caused by the fact sock_kmalloc call inside the function tried
to allocate more memory than allowed by the default kernel socket buffer
size (kernel param net.core.optmem_max).
Signed-off-by: Ondrej Kozina <okozina@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/algif_skcipher.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index a19c027b29bd..83187f497c7c 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c | |||
@@ -49,7 +49,7 @@ struct skcipher_ctx { | |||
49 | struct ablkcipher_request req; | 49 | struct ablkcipher_request req; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define MAX_SGL_ENTS ((PAGE_SIZE - sizeof(struct skcipher_sg_list)) / \ | 52 | #define MAX_SGL_ENTS ((4096 - sizeof(struct skcipher_sg_list)) / \ |
53 | sizeof(struct scatterlist) - 1) | 53 | sizeof(struct scatterlist) - 1) |
54 | 54 | ||
55 | static inline int skcipher_sndbuf(struct sock *sk) | 55 | static inline int skcipher_sndbuf(struct sock *sk) |