All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Ofir Drang <ofir.drang@arm.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: testmgr - properly mark the end of scatterlist
Date: Mon, 27 Jan 2020 18:40:35 -0800	[thread overview]
Message-ID: <20200128024035.GD960@sol.localdomain> (raw)
In-Reply-To: <20200127123311.7137-1-gilad@benyossef.com>

On Mon, Jan 27, 2020 at 02:33:11PM +0200, Gilad Ben-Yossef wrote:
> The inauthentic AEAD test were using a scatterlist which
> could have a mismarked end node.
> 
> Fixes: 49763fc6b1 ("crypto: testmgr - generate inauthentic AEAD test vectors")
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> 
> ---
>  crypto/testmgr.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index 88f33c0efb23..6c432aecff97 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -2225,6 +2225,8 @@ static void generate_aead_message(struct aead_request *req,
>  			generate_random_bytes((u8 *)vec->ptext, vec->plen);
>  			sg_set_buf(&src[i++], vec->ptext, vec->plen);
>  		}
> +		if (i)
> +			sg_mark_end(&src[(i-1)]);
>  		sg_init_one(&dst, vec->ctext, vec->alen + vec->clen);
>  		memcpy(iv, vec->iv, ivsize);
>  		aead_request_set_callback(req, 0, crypto_req_done, &wait);

As I responded in the other thread
(https://lkml.kernel.org/linux-crypto/20200128023455.GC960@sol.localdomain/),
I'm not sure this is really a bug.  There's a length passed along with the
scatterlist, and my understanding is that algorithms aren't supposed to look
beyond that length.  So the scatterlist end marker isn't really relevant.

- Eric

      reply	other threads:[~2020-01-28  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 12:33 [PATCH] crypto: testmgr - properly mark the end of scatterlist Gilad Ben-Yossef
2020-01-28  2:40 ` Eric Biggers [this message]

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=20200128024035.GD960@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=davem@davemloft.net \
    --cc=gilad@benyossef.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ofir.drang@arm.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.