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 16:48:00 +0000 (08:48 -0800)
commit591189c21235f0c2884cfae24b65ecfb5e120325
treeaf2758bedcee666e84d34dbb47871185d1f3754a
parentb089fe5b6d7fe1ad383dd2ffcb2e4ce4ee0c574d
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