linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-crypto@vger.kernel.org, colin.king@canonical.com
Subject: Re: [PATCH] crypto: xts - Replace memcpy() invocation with simple assignment
Date: Fri, 31 Jul 2020 23:29:56 +1000	[thread overview]
Message-ID: <20200731132956.GD14360@gondor.apana.org.au> (raw)
In-Reply-To: <20200721060554.8151-1-ardb@kernel.org>

On Tue, Jul 21, 2020 at 09:05:54AM +0300, Ard Biesheuvel wrote:
> Colin reports that the memcpy() call in xts_cts_final() trigggers a
> "Overlapping buffer in memory copy" warning in Coverity, which is a
> false postive, given that tail is guaranteed to be smaller than or
> equal to the distance between source and destination.
> 
> However, given that any additional bytes that we copy will be ignored
> anyway, we can simply copy XTS_BLOCK_SIZE unconditionally, which means
> we can use struct assignment of the array members instead, which is
> likely to be more efficient as well.
> 
> Addresses-Coverity: ("Overlapping buffer in memory copy")
> Fixes: 8083b1bf8163 ("crypto: xts - add support for ciphertext stealing")
> Reported-by: Colin Ian King <colin.king@canonical.com>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>  crypto/xts.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
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:[~2020-07-31 13:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  6:05 [PATCH] crypto: xts - Replace memcpy() invocation with simple assignment Ard Biesheuvel
2020-07-31 13:29 ` Herbert Xu [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=20200731132956.GD14360@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=ardb@kernel.org \
    --cc=colin.king@canonical.com \
    --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;
as well as URLs for NNTP newsgroup(s).