linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: keescook@chromium.org, jwboyer@redhat.com, smueller@chronox.de,
	richard@nod.at, steved@redhat.com, linux-kernel@vger.kernel.org,
	dhowells@redhat.com, linux-crypto@vger.kernel.org,
	james.l.morris@oracle.com, jkosina@suse.cz,
	zohar@linux.vnet.ibm.com, davem@davemloft.net, vgoyal@redhat.com
Subject: Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer
Date: Fri, 14 Aug 2015 13:14:10 +0800	[thread overview]
Message-ID: <20150814051410.GA2370@gondor.apana.org.au> (raw)
In-Reply-To: <20150813035445.25108.76927.stgit@tstruk-mobl1>

On Wed, Aug 12, 2015 at 08:54:45PM -0700, Tadeusz Struk wrote:
> Don't need to move data inside of the output buffer
> because SW doen't need to do this anymore sice the new MPI
> mpi_read_buf() has been added. Just set the correct output len.
> 
> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
> ---
>  drivers/crypto/qat/qat_common/qat_asym_algs.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c
> index fe352a6..6ddb13c 100644
> --- a/drivers/crypto/qat/qat_common/qat_asym_algs.c
> +++ b/drivers/crypto/qat/qat_common/qat_asym_algs.c
> @@ -144,9 +144,6 @@ static void qat_rsa_cb(struct icp_qat_fw_pke_resp *resp)
>  		ptr++;
>  	}
>  
> -	if (areq->dst_len != req->ctx->key_sz)
> -		memcpy(areq->dst, ptr, areq->dst_len);
> -

This looks wrong.  It appears to be trying to remove leading
zeroes so you can't just change the length because then you end
up removing the trailing digits equal to the number of leading
zeroes.

The existing code is also wrong as you should be using memmove
instead of memcpy.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  parent reply	other threads:[~2015-08-14  5:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13  3:54 [PATCH 0/2] crypto: KEYS: convert public key to the akcipher API Tadeusz Struk
2015-08-13  3:54 ` [PATCH 1/2] " Tadeusz Struk
2015-08-15 18:08   ` Stephan Mueller
2015-08-24 17:45     ` Tadeusz Struk
2015-08-13  3:54 ` [PATCH 2/2] crypto: qat - Don't move data inside output buffer Tadeusz Struk
2015-08-13 16:40   ` Tadeusz Struk
2015-08-14  5:14   ` Herbert Xu [this message]
2015-08-14  6:14     ` Tadeusz Struk
2015-08-14  6:26       ` Herbert Xu
2015-08-14 14:21         ` Tadeusz Struk
2015-08-17  8:48           ` Herbert Xu
2015-08-14 14:24         ` Tadeusz Struk
2015-08-17  8:50           ` Herbert Xu
2015-08-18  1:05             ` Tadeusz Struk
2015-08-18  2:39               ` Herbert Xu
2015-08-13 13:56 ` [PATCH 0/2] crypto: KEYS: convert public key to the akcipher API David Howells
2015-08-13 16:44   ` Tadeusz Struk
2015-08-13 14:23 ` [PATCH 1/2] " David Howells
2015-08-13 16:47   ` Tadeusz Struk
2015-08-14  1:09   ` Herbert Xu

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=20150814051410.GA2370@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=james.l.morris@oracle.com \
    --cc=jkosina@suse.cz \
    --cc=jwboyer@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=smueller@chronox.de \
    --cc=steved@redhat.com \
    --cc=tadeusz.struk@intel.com \
    --cc=vgoyal@redhat.com \
    --cc=zohar@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).