crypto: algif - avoid excessive use of socket buffer in skcipher
authorOndrej Kozina <okozina@redhat.com>
Mon, 25 Aug 2014 09:49:54 +0000 (11:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Nov 2014 17:00:11 +0000 (09:00 -0800)
commitd8325cceb317d5c83f117eda75c84f870cfa8c09
tree3145c8353a06364b6e7cf5f570052295d0270d3a
parentda357d7aab5e47f5a9bd806980f4cbb1e76f523d
crypto: algif - avoid excessive use of socket buffer in skcipher

commit e2cffb5f493a8b431dc87124388ea59b79f0bccb upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/algif_skcipher.c