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


Groups > linux.kernel > #1312329

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

From Tadeusz Struk <tadeusz.struk@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] crypto: af_alg - add async support to algif_aead
Date 2016-01-19 16:30 +0100
Message-ID <qSGoi-1fW-25@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>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/18/2016 04:34 PM, Herbert Xu wrote:
>> My understanding is that the sock_kmalloc is mainly used for allocations
>> > of the user provided  data, because it keeps tracks of how much memory
>> > is allocated by a socket, and makes sure that is will not exceed the
>> > sysctl_optmem_max limit. Usually the internal structures, with fixed
>> > size are allocated simply with kmalloc. I don't think that using
>> > sock_kmalloc will give us any benefit here.
> If there is only ever one of them per-socket then kmalloc is fine,
> otherwise you should use sock_kmalloc.

There is one per request. There can be a few of them at a given time.
We have the same thing in skcipher and we use kmalloc there. 

> 
>> I agree that they are very similar, but I found it much easier to debug
>> > when they are separate functions. I would prefer to keep them separate.
>> > They are also separate in algif_skcipher. It makes it also easier to
>> > read and understand.
> I too would prefer a common function.  However we can do this
> later if we wish.
>  

lets do this later then.

> 
>> > The inflight ctr is incremented only if an asynchronous request has been
>> > successfully en-queued for processing. If a user forges to call recvmsg
>> > then the function that increments it won't be even called.
>> > >From the other hand we don't want to give the option to interrupt the
>> > wait, because in a case, when we do have request being processed by some
>> > hardware, and the user kills the process, causing the socket to be
>> > freed, then we will get an Oops in the callback.
> This should be replaced with a sock_hold.

Ok, I will try sock_hold.
Thanks,

-- 
TS

Back to linux.kernel | Previous | NextPrevious in thread | Next 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