Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-31 Thread Herbert Xu
On Thu, Mar 16, 2017 at 11:18:33AM +0100, Stephan Müller wrote: > Am Donnerstag, 16. März 2017, 10:52:48 CET schrieb Herbert Xu: > > Hi Herbert, > > > First of all you're only limiting the amount of memory occupied > > by the SG list which is not the same thing as the memory pinned > > down by

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-30 Thread Stephan Müller
Am Donnerstag, 16. März 2017, 10:52:48 CEST schrieb Herbert Xu: Hi Herbert, > More importantly, with the current code, a very large recvmsg > would still work by doing it piecemeal. With your patch, won't > it fail because sock_kmalloc could fail to allocate memory for > the whole thing? For

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-18 Thread Stephan Müller
Am Donnerstag, 16. März 2017, 10:52:48 CET schrieb Herbert Xu: Hi Herbert, > > First of all you're only limiting the amount of memory occupied > by the SG list which is not the same thing as the memory pinned > down by the actual recvmsg. When considering af_alg_make_sg, the function

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Stephan Müller
Am Donnerstag, 16. März 2017, 11:18:33 CET schrieb Stephan Müller: Hi Stephan, > Am Donnerstag, 16. März 2017, 10:52:48 CET schrieb Herbert Xu: > > Hi Herbert, > > > First of all you're only limiting the amount of memory occupied > > by the SG list which is not the same thing as the memory

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Stephan Müller
Am Donnerstag, 16. März 2017, 10:52:48 CET schrieb Herbert Xu: Hi Herbert, > First of all you're only limiting the amount of memory occupied > by the SG list which is not the same thing as the memory pinned > down by the actual recvmsg. I am fully aware of that. As this was present in the code,

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Herbert Xu
On Thu, Mar 16, 2017 at 10:23:49AM +0100, Stephan Müller wrote: > Am Donnerstag, 16. März 2017, 10:08:23 CET schrieb Herbert Xu: > > Hi Herbert, > > > On Thu, Mar 16, 2017 at 09:55:17AM +0100, Stephan Müller wrote: > > > With this approach I thought that the while loop could be a thing of the >

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Stephan Müller
Am Donnerstag, 16. März 2017, 10:08:23 CET schrieb Herbert Xu: Hi Herbert, > On Thu, Mar 16, 2017 at 09:55:17AM +0100, Stephan Müller wrote: > > With this approach I thought that the while loop could be a thing of the > > past, considering that this is also the approach taken in > >

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Herbert Xu
On Thu, Mar 16, 2017 at 09:55:17AM +0100, Stephan Müller wrote: > > With this approach I thought that the while loop could be a thing of the > past, > considering that this is also the approach taken in skcipher_recvmsg_async > that is present in the current upstream code base. The reason

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Stephan Müller
Am Donnerstag, 16. März 2017, 09:39:23 CET schrieb Herbert Xu: Hi Herbert, > On Fri, Feb 17, 2017 at 11:31:41PM +0100, Stephan Müller wrote: > > + } else { > > + /* Synchronous operation */ > > + skcipher_request_set_callback(>req, > > +

Re: [PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-03-16 Thread Herbert Xu
On Fri, Feb 17, 2017 at 11:31:41PM +0100, Stephan Müller wrote: > > + } else { > + /* Synchronous operation */ > + skcipher_request_set_callback(>req, > + CRYPTO_TFM_REQ_MAY_SLEEP | > +

[PATCH v5 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-02-17 Thread Stephan Müller
The updated memory management is described in the top part of the code. As one benefit of the changed memory management, the AIO and synchronous operation is now implemented in one common function. The AF_ALG operation uses the async kernel crypto API interface for each cipher operation. Thus, the