Re: [PATCH] crypto: AF_ALG - wait for data at beginning of recvmsg

2017-11-29 Thread Herbert Xu
On Wed, Nov 29, 2017 at 11:28:43AM +0100, Stephan Mueller wrote: > Am Mittwoch, 29. November 2017, 11:22:34 CET schrieb Herbert Xu: > > Hi Herbert, > > > On Wed, Nov 29, 2017 at 11:17:26AM +0100, Stephan Müller wrote: > > > @@ -111,6 +111,12 @@ static int _aead_recvmsg(struct socket *sock, struct

Re: [PATCH] crypto: AF_ALG - wait for data at beginning of recvmsg

2017-11-29 Thread Stephan Mueller
Am Mittwoch, 29. November 2017, 11:22:34 CET schrieb Herbert Xu: Hi Herbert, > On Wed, Nov 29, 2017 at 11:17:26AM +0100, Stephan Müller wrote: > > @@ -111,6 +111,12 @@ static int _aead_recvmsg(struct socket *sock, struct > > msghdr *msg,> > > size_t usedpages = 0; /* [in] RX bufs

Re: [PATCH] crypto: AF_ALG - wait for data at beginning of recvmsg

2017-11-29 Thread Herbert Xu
On Wed, Nov 29, 2017 at 11:17:26AM +0100, Stephan Müller wrote: > > @@ -111,6 +111,12 @@ static int _aead_recvmsg(struct socket *sock, struct > msghdr *msg, > size_t usedpages = 0; /* [in] RX bufs to be used from user */ > size_t processed = 0; /* [in] TX bufs to

[PATCH] crypto: AF_ALG - wait for data at beginning of recvmsg

2017-11-29 Thread Stephan Müller
The wait for data is a non-atomic operation that can sleep and therefore potentially release the socket lock. The release of the socket lock allows another thread to modify the context data structure. The waiting operation for new data therefore must be called at the beginning of recvmsg. This prev