Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1313872

Re: [PATCH] crypto: af_alg - add async support to algif_aead

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH] crypto: af_alg - add async support to algif_aead
Date 2016-01-21 06:10 +0100
Message-ID <qTfFp-tF-21@gated-at.bofh.it> (permalink)
References <qRiem-23s-17@gated-at.bofh.it> <qRX7P-43J-1@gated-at.bofh.it> <qSjUK-2vA-11@gated-at.bofh.it> <qSsv0-8sj-3@gated-at.bofh.it> <qT7ya-3ae-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 20, 2016 at 12:18:24PM -0800, Tadeusz Struk wrote:
>
> I tried sock_kmalloc and it will not work. The sysctl_optmem_max by
> default is 20480 bytes. The aead ctx by itself takes more than half of
> it (11832 bytes). A single async request takes 11408 bytes.
> It means we need to use kmalloc or no async request could be allocated.
> I would opt to go with this version and I'll convert both algif_aead
> and algif_skcipher to use sock_hold later.

Then we have to make it smaller.  The whole point of this is to
stop the user from allocating too much kernel memory, and if you
are allocating too much memory to start with...

So instead of allocating RSGL_MAX_ENTRIES you should turn it into
a linked list like algif_skcipher and then allocate it on demand
using sock_kmalloc.

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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-15 20:30 +0100
  Re: [PATCH] crypto: af_alg - add async support to algif_aead Stephan Mueller <smueller@chronox.de> - 2016-01-17 16:10 +0100
    Re: [PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tstruk@gmail.com> - 2016-01-18 16:30 +0100
      Re: [PATCH] crypto: af_alg - add async support to algif_aead Herbert Xu <herbert@gondor.apana.org.au> - 2016-01-19 01:40 +0100
        Re: [PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-19 16:30 +0100
        Re: [PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-20 21:30 +0100
          Re: [PATCH] crypto: af_alg - add async support to algif_aead Herbert Xu <herbert@gondor.apana.org.au> - 2016-01-21 06:10 +0100

csiph-web