All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Lokesh Vutla <lokeshvutla@ti.com>
Cc: linux-crypto@vger.kernel.org, davem@davemloft.net,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	t-kristo@ti.com, nsekhar@ti.com
Subject: Re: [PATCH v3] crypto: omap-aes: Add support for GCM mode
Date: Fri, 18 Sep 2015 21:17:13 +0800	[thread overview]
Message-ID: <20150918131713.GF7638@gondor.apana.org.au> (raw)
In-Reply-To: <1442323681-6538-1-git-send-email-lokeshvutla@ti.com>

On Tue, Sep 15, 2015 at 06:58:01PM +0530, Lokesh Vutla wrote:
>
> +	assoc = &req->src[0];
> +	sg_init_table(dd->in_sgl, nsg + 1);
> +	if (assoclen) {
> +		if (omap_aes_check_aligned(assoc, assoclen)) {
> +			dd->sgs_copied |= AES_ASSOC_DATA_COPIED;
> +			pages = get_order(alen);
> +			buf_in = (void *)__get_free_pages(GFP_ATOMIC, pages);

It would be better if you used a list of pages rather than n
contiguous pages which is likely to fail.

> +			buf_in = sg_virt(assoc);

This is bogus as assoc may not be mapped.

> +	if (req->cryptlen) {
> +		input = scatterwalk_ffwd(tmp, req->src, req->assoclen);

scatterwalk_ffwd may return tmp so tmp must not be on the stack
unless you stop using input after the function returns.  Also tmp
must not be reused by a subsequent call to scatterwalk_ffwd.

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

  reply	other threads:[~2015-09-18 13:17 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 15:31 [PATCH v2 0/7] crypto: omap-aes: Add support for GCM mode Lokesh Vutla
2015-07-07 15:31 ` Lokesh Vutla
2015-07-07 15:31 ` [PATCH v2 1/7] crypto: omap-aes: Fix CTR mode Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-07 15:31 ` [PATCH v2 2/7] crypto: omap-aes: Increase priority of hw accelerator Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-07 15:31 ` [PATCH v2 3/7] crypto: omap-aes: Fix configuring of AES mode Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-07 15:31 ` [PATCH v2 4/7] crypto: omap-aes: Use BIT() macro Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-07 15:31 ` [PATCH v2 5/7] crypto: aead: Add aead_request_cast() api Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-08  3:56   ` Herbert Xu
2015-07-08  6:43     ` Lokesh Vutla
2015-07-08  6:43       ` Lokesh Vutla
2015-07-07 15:31 ` [PATCH v2 6/7] crypto: omap-aes: Add support for GCM mode Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-08  4:18   ` Herbert Xu
2015-07-08  6:59     ` Lokesh Vutla
2015-07-08  6:59       ` Lokesh Vutla
2015-07-08  7:48       ` Herbert Xu
2015-07-08  7:53         ` Herbert Xu
2015-07-08  8:30           ` Lokesh Vutla
2015-07-08  8:30             ` Lokesh Vutla
2015-07-08  8:15         ` Lokesh Vutla
2015-07-08  8:15           ` Lokesh Vutla
2015-07-10 14:09     ` Lokesh Vutla
2015-07-10 14:09       ` Lokesh Vutla
2015-07-11  2:40       ` Herbert Xu
2015-09-15 13:28   ` [PATCH v3] " Lokesh Vutla
2015-09-15 13:28     ` Lokesh Vutla
2015-09-18 13:17     ` Herbert Xu [this message]
2015-09-20 10:38     ` Matthijs van Duin
2015-07-07 15:31 ` [PATCH v2 7/7] crypto: tcrypt: Fix AEAD speed tests Lokesh Vutla
2015-07-07 15:31   ` Lokesh Vutla
2015-07-08  7:11 ` [PATCH v2 0/7] crypto: omap-aes: Add support for GCM mode 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=20150918131713.GF7638@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=nsekhar@ti.com \
    --cc=t-kristo@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.