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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Freitag, 23. Juni 2017, 08:10:48 CEST schrieb Herbert Xu:

Hi Herbert,

> On Wed, Jun 21, 2017 at 10:03:02PM +0200, Stephan Müller wrote:
> > +	/* convert iovecs of output buffers into RX SGL */
> > +	while (len < ctx->used && msg_data_left(msg)) {
> 
> How are we supposed to reach the wait path when ctx->used == 0?

Right. 

May I ask whether that wait is correct to begin with? The recvmsg is protected 
by a lock_sock. Thus, if the code is waiting, the lock is still held. So, how 
can data be inserted into the socket by sendmsg/sendpage while recvmsg is 
waiting? Don't we have a deadlock here?
> 
> > +		/*
> > +		 * This error covers -EIOCBQUEUED which implies that we can
> > +		 * only handle one AIO request. If the caller wants to have
> > +		 * multiple AIO requests in parallel, he must make multiple
> > +		 * separate AIO calls.
> > +		 */
> > +		if (err < 0) {
> > +			if (err == -EIOCBQUEUED)
> > +				ret = err;
> > +			goto out;
> > 
> >  		}
> > 
> > +		if (!err)
> > +			goto out;
> 
> You can combine the two now as err <= 0.

Fixed, thank you.
> 
> Thanks,



Ciao
Stephan



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux