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@xxxxxxxxxxxxx> > Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx> > --- > crypto/xts.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt