Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "Stephan Müller" <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH v10 1/2] crypto: skcipher AF_ALG - overhaul memory management
Date: Fri, 23 Jun 2017 11:06:30 +0200	[thread overview]
Message-ID: <13379757.uGWUeJijgc@tauon.chronox.de> (raw)
In-Reply-To: <20170623061048.GA28869@gondor.apana.org.au>

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

  reply	other threads:[~2017-06-23  9:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 20:02 [PATCH v10 0/2] crypto: AF_ALG memory management fix Stephan Müller
2017-06-21 20:03 ` [PATCH v10 1/2] crypto: skcipher AF_ALG - overhaul memory management Stephan Müller
2017-06-23  6:10   ` Herbert Xu
2017-06-23  9:06     ` Stephan Müller [this message]
2017-06-25 15:01       ` Stephan Müller
2017-06-21 20:03 ` [PATCH v10 2/2] crypto: aead " Stephan Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13379757.uGWUeJijgc@tauon.chronox.de \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox