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

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

 



Am Dienstag, 20. Juni 2017, 05:10:42 CEST schrieb Herbert Xu:

Hi Herbert,

> > +		int err = _skcipher_recvmsg(sock, msg, ignored, flags);
> > +
> > +		/*
> > +		 * 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) {
> > +			ret = err;
> > +			goto out;
> 
> This looks like a semantic change.  The previous code would return
> the number of bytes already successfully processed in case of a
> subsequent error.  With your new code you will always return the
> error.

In the current code, the synchronous returns the processed bytes whereas the 
async case returns EIOCBQUEUED if this error occurs without returning the 
processed bytes.

Thus, would you like to change that code into

if (err < 0) {
	if (err == -EIOCBQUEUED)
		ret = err;

	goto out;
}

?


> 
> > @@ -724,10 +737,9 @@ static unsigned int skcipher_poll(struct file *file,
> > struct socket *sock,> 
> >  	struct sock *sk = sock->sk;
> >  	struct alg_sock *ask = alg_sk(sk);
> >  	struct skcipher_ctx *ctx = ask->private;
> > 
> > -	unsigned int mask;
> > +	unsigned int mask = 0;
> > 
> >  	sock_poll_wait(file, sk_sleep(sk), wait);
> > 
> > -	mask = 0;
> > 
> >  	if (ctx->used)
> >  	
> >  		mask |= POLLIN | POLLRDNORM;
> 
> Please remove this hunk as it has nothing to do with this patch.

Removed.

Thanks

Ciao
Stephan



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

  Powered by Linux